evolution r34904 - branches/mbarnes-composer/composer



Author: mbarnes
Date: Mon Jan 28 01:17:46 2008
New Revision: 34904
URL: http://svn.gnome.org/viewvc/evolution?rev=34904&view=rev

Log:
Get some basic cleanups out of the way.


Modified:
   branches/mbarnes-composer/composer/e-msg-composer.c
   branches/mbarnes-composer/composer/e-msg-composer.h

Modified: branches/mbarnes-composer/composer/e-msg-composer.c
==============================================================================
--- branches/mbarnes-composer/composer/e-msg-composer.c	(original)
+++ branches/mbarnes-composer/composer/e-msg-composer.c	Mon Jan 28 01:17:46 2008
@@ -30,7 +30,7 @@
 
    TODO
 
-   - Somehow users should be able to see if any file(s) are attached even when
+   - Somehow users should be able to see if any file (s) are attached even when
      the attachment bar is not shown.
 
    Should use EventSources to keep track of global changes made to configuration
@@ -137,6 +137,10 @@
 
 #define d(x)
 
+#define E_MSG_COMPOSER_GET_PRIVATE(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE \
+	((obj), E_TYPE_MSG_COMPOSER, EMsgComposerPrivate))
+
 #define E_MSG_COMPOSER_VISIBLE_MASK_SENDER \
 	(E_MSG_COMPOSER_VISIBLE_FROM | \
 	 E_MSG_COMPOSER_VISIBLE_REPLYTO)
@@ -158,8 +162,6 @@
 	(E_MSG_COMPOSER_VISIBLE_MASK_BASIC | \
 	 E_MSG_COMPOSER_VISIBLE_POSTTO)
 
-typedef struct _EMsgComposerPrivate EMsgComposerPrivate;
-
 typedef enum {
 	E_MSG_COMPOSER_VISIBLE_FROM       = (1 << 0),
 	E_MSG_COMPOSER_VISIBLE_REPLYTO    = (1 << 1),
@@ -170,23 +172,8 @@
 	E_MSG_COMPOSER_VISIBLE_SUBJECT    = (1 << 7)
 } EMsgComposerHeaderVisibleFlags;
 
-struct _EMsgComposer {
-	BonoboWindow parent;
-
-	EMsgComposerPrivate *priv;
-};
-
-struct _EMsgComposerClass {
-	BonoboWindowClass parent_class;
-
-	void (* send) (EMsgComposer *composer);
-	void (* save_draft) (EMsgComposer *composer, int quit);
-};
-
-
 struct _EMsgComposerPrivate {
 
-
 /* Main UIComponent */
 	BonoboUIComponent *uic;
 
@@ -217,10 +204,10 @@
 	GHashTable              *inline_images, *inline_images_by_url;
 	GList                   *current_images;
 
-	char *mime_type, *mime_body, *charset;
+	gchar *mime_type, *mime_body, *charset;
 
-	char *autosave_file;
-	int   autosave_fd;
+	gchar *autosave_file;
+	gint   autosave_fd;
 	guint32 enable_autosave        : 1;
 
 	guint32 attachment_bar_visible : 1;
@@ -264,66 +251,63 @@
 	LAST_SIGNAL
 };
 
-static guint signals[LAST_SIGNAL] = { 0 };
-
 enum {
 	DND_TYPE_MESSAGE_RFC822,
 	DND_TYPE_X_UID_LIST,
 	DND_TYPE_TEXT_URI_LIST,
 	DND_TYPE_NETSCAPE_URL,
 	DND_TYPE_TEXT_VCARD,
-	DND_TYPE_TEXT_CALENDAR,
+	DND_TYPE_TEXT_CALENDAR
 };
 
 static GtkTargetEntry drop_types[] = {
 	{ "message/rfc822", 0, DND_TYPE_MESSAGE_RFC822 },
-	{ "x-uid-list", 0, DND_TYPE_X_UID_LIST },
-	{ "text/uri-list", 0, DND_TYPE_TEXT_URI_LIST },
-	{ "_NETSCAPE_URL", 0, DND_TYPE_NETSCAPE_URL },
-	{ "text/x-vcard", 0, DND_TYPE_TEXT_VCARD },
-	{ "text/calendar", 0, DND_TYPE_TEXT_CALENDAR },
+	{ "x-uid-list",     0, DND_TYPE_X_UID_LIST },
+	{ "text/uri-list",  0, DND_TYPE_TEXT_URI_LIST },
+	{ "_NETSCAPE_URL",  0, DND_TYPE_NETSCAPE_URL },
+	{ "text/x-vcard",   0, DND_TYPE_TEXT_VCARD },
+	{ "text/calendar",  0, DND_TYPE_TEXT_CALENDAR }
 };
 
-#define num_drop_types (sizeof (drop_types) / sizeof (drop_types[0]))
-
 static struct {
-	char *target;
+	gchar *target;
 	GdkAtom atom;
 	guint32 actions;
 } drag_info[] = {
 	{ "message/rfc822", NULL, GDK_ACTION_COPY },
-	{ "x-uid-list", NULL, GDK_ACTION_ASK|GDK_ACTION_MOVE|GDK_ACTION_COPY },
-	{ "text/uri-list", NULL, GDK_ACTION_COPY },
-	{ "_NETSCAPE_URL", NULL, GDK_ACTION_COPY },
-	{ "text/x-vcard", NULL, GDK_ACTION_COPY },
-	{ "text/calendar", NULL, GDK_ACTION_COPY },
+	{ "x-uid-list",     NULL, GDK_ACTION_ASK |
+                                  GDK_ACTION_MOVE |
+                                  GDK_ACTION_COPY },
+	{ "text/uri-list",  NULL, GDK_ACTION_COPY },
+	{ "_NETSCAPE_URL",  NULL, GDK_ACTION_COPY },
+	{ "text/x-vcard",   NULL, GDK_ACTION_COPY },
+	{ "text/calendar",  NULL, GDK_ACTION_COPY }
 };
 
-static const char *emc_draft_format_names[] = { "pgp-sign", "pgp-encrypt", "smime-sign", "smime-encrypt" };
+static const gchar *emc_draft_format_names[] = { "pgp-sign", "pgp-encrypt", "smime-sign", "smime-encrypt" };
 
-
-/* The parent class.  */
-static BonoboWindowClass *parent_class = NULL;
+static gpointer parent_class;
+static guint signals[LAST_SIGNAL];
 
 /* All the composer windows open, for bookkeeping purposes.  */
 static GSList *all_composers = NULL;
 
 
 /* local prototypes */
-static GList *add_recipients (GList *list, const char *recips);
+static GList *add_recipients (GList *list, const gchar *recips);
 
-static void handle_mailto (EMsgComposer *composer, const char *mailto);
-static void handle_uri    (EMsgComposer *composer, const char *uri, gboolean html_dnd);
+static void handle_mailto (EMsgComposer *composer, const gchar *mailto);
+static void handle_uri    (EMsgComposer *composer, const gchar *uri, gboolean html_dnd);
 
-/* used by e_msg_composer_add_message_attachments() */
+/* used by e_msg_composer_add_message_attachments () */
 static void add_attachments_from_multipart (EMsgComposer *composer, CamelMultipart *multipart,
-					    gboolean just_inlines, int depth);
+					    gboolean just_inlines, gint depth);
 
-/* used by e_msg_composer_new_with_message() */
-static void handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth);
-static void handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, int depth);
-static void handle_multipart_encrypted (EMsgComposer *composer, CamelMimePart *multipart, int depth);
-static void handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int depth);
+/* used by e_msg_composer_new_with_message () */
+static void handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, gint depth);
+static void handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, gint depth);
+static void handle_multipart_encrypted (EMsgComposer *composer, CamelMimePart *multipart, gint depth);
+static void handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, gint depth);
 
 static void set_editor_signature (EMsgComposer *composer);
 
@@ -331,10 +315,10 @@
 static void e_msg_composer_show_help (EMsgComposer *composer);
 
 static EDestination**
-destination_list_to_vector_sized (GList *list, int n)
+destination_list_to_vector_sized (GList *list, gint n)
 {
 	EDestination **destv;
-	int i = 0;
+	gint i = 0;
 
 	if (n == -1)
 		n = g_list_length (list);
@@ -361,7 +345,7 @@
 }
 
 static GByteArray *
-get_text (Bonobo_PersistStream persist, char *format)
+get_text (Bonobo_PersistStream persist, gchar *format)
 {
 	BonoboStream *stream;
 	BonoboStreamMem *stream_mem;
@@ -392,11 +376,11 @@
 #define LINE_LEN 72
 
 static CamelTransferEncoding
-best_encoding (GByteArray *buf, const char *charset)
+best_encoding (GByteArray *buf, const gchar *charset)
 {
-	char *in, *out, outbuf[256], *ch;
+	gchar *in, *out, outbuf[256], *ch;
 	size_t inlen, outlen;
-	int status, count = 0;
+	gint status, count = 0;
 	iconv_t cd;
 
 	if (!charset)
@@ -406,14 +390,14 @@
 	if (cd == (iconv_t) -1)
 		return -1;
 
-	in = (char*)buf->data;
+	in = (gchar *) buf->data;
 	inlen = buf->len;
 	do {
 		out = outbuf;
 		outlen = sizeof (outbuf);
-		status = e_iconv (cd, (const char **) &in, &inlen, &out, &outlen);
+		status = e_iconv (cd, (const gchar **) &in, &inlen, &out, &outlen);
 		for (ch = out - 1; ch >= outbuf; ch--) {
-			if ((unsigned char)*ch > 127)
+			if ((guchar) *ch > 127)
 				count++;
 		}
 	} while (status == (size_t) -1 && errno == E2BIG);
@@ -430,12 +414,12 @@
 		return CAMEL_TRANSFER_ENCODING_BASE64;
 }
 
-static char *
+static gchar *
 composer_get_default_charset_setting (void)
 {
 	GConfClient *gconf;
-	const char *locale;
-	char *charset;
+	const gchar *locale;
+	gchar *charset;
 
 	gconf = gconf_client_get_default ();
 	charset = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
@@ -457,10 +441,10 @@
 	return charset ? charset : g_strdup ("us-ascii");
 }
 
-static char *
-best_charset (GByteArray *buf, const char *default_charset, CamelTransferEncoding *encoding)
+static gchar *
+best_charset (GByteArray *buf, const gchar *default_charset, CamelTransferEncoding *encoding)
 {
-	char *charset;
+	gchar *charset;
 
 	/* First try US-ASCII */
 	*encoding = best_encoding (buf, "US-ASCII");
@@ -542,9 +526,9 @@
 	CamelInternetAddress *cc_addr;
 	CamelInternetAddress *bcc_addr;
 	CamelInternetAddress *target;
-	const char *text_addr, *header;
+	const gchar *text_addr, *header;
 	gboolean seen_hidden_list = FALSE;
-	int i;
+	gint i;
 
 	to_addr  = camel_internet_address_new ();
 	cc_addr  = camel_internet_address_new ();
@@ -708,7 +692,7 @@
 	EComposerHeaderTable *table;
 	CamelDataWrapper *plain, *html, *current;
 	CamelTransferEncoding plain_encoding;
-	const char *iconv_charset = NULL;
+	const gchar *iconv_charset = NULL;
 	GPtrArray *recipients = NULL;
 	CamelMultipart *body = NULL;
 	CamelContentType *type;
@@ -718,8 +702,8 @@
 	CamelException ex;
 	GByteArray *data;
 	EAccount *account;
-	char *charset;
-	int i;
+	gchar *charset;
+	gint i;
 
 	table = e_msg_composer_get_header_table (composer);
 	account = e_composer_header_table_get_account (table);
@@ -744,7 +728,7 @@
 
 	/* Message Disposition Notification */
 	if (p->request_receipt) {
-		char *mdn_address = account->id->reply_to;
+		gchar *mdn_address = account->id->reply_to;
 		if (!mdn_address || !*mdn_address)
 			mdn_address = account->id->address;
 
@@ -758,7 +742,7 @@
 	if (p->mime_body) {
 		plain_encoding = CAMEL_TRANSFER_ENCODING_7BIT;
 		for (i = 0; p->mime_body[i]; i++) {
-			if ((unsigned char) p->mime_body[i] > 127) {
+			if ((guchar) p->mime_body[i] > 127) {
 				plain_encoding = CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE;
 				break;
 			}
@@ -922,23 +906,23 @@
 	    || p->smime_encrypt
 #endif
 		) {
-		int j;
-		const char *types[] = { CAMEL_RECIPIENT_TYPE_TO, CAMEL_RECIPIENT_TYPE_CC, CAMEL_RECIPIENT_TYPE_BCC };
+		gint j;
+		const gchar *types[] = { CAMEL_RECIPIENT_TYPE_TO, CAMEL_RECIPIENT_TYPE_CC, CAMEL_RECIPIENT_TYPE_BCC };
 
-		recipients = g_ptr_array_new();
-		for (i=0; i < sizeof(types)/sizeof(types[0]); i++) {
+		recipients = g_ptr_array_new ();
+		for (i = 0; i < G_N_ELEMENTS (types); i++) {
 			const CamelInternetAddress *addr;
-			const char *address;
+			const gchar *address;
 
-			addr = camel_mime_message_get_recipients(new, types[i]);
-			for (j=0;camel_internet_address_get(addr, j, NULL, &address); j++)
-				g_ptr_array_add(recipients, g_strdup (address));
+			addr = camel_mime_message_get_recipients (new, types[i]);
+			for (j=0;camel_internet_address_get (addr, j, NULL, &address); j++)
+				g_ptr_array_add (recipients, g_strdup (address));
 
 		}
 	}
 
 	if (p->pgp_sign || p->pgp_encrypt) {
-		const char *pgp_userid;
+		const gchar *pgp_userid;
 		CamelInternetAddress *from = NULL;
 		CamelCipherContext *cipher;
 		EAccount *account;
@@ -955,41 +939,41 @@
 			pgp_userid = account->pgp_key;
 		} else {
 			from = e_msg_composer_get_from (composer);
-			camel_internet_address_get(from, 0, NULL, &pgp_userid);
+			camel_internet_address_get (from, 0, NULL, &pgp_userid);
 		}
 
 		if (p->pgp_sign) {
-			CamelMimePart *npart = camel_mime_part_new();
+			CamelMimePart *npart = camel_mime_part_new ();
 
-			cipher = mail_crypto_get_pgp_cipher_context(account);
-			camel_cipher_sign(cipher, pgp_userid, CAMEL_CIPHER_HASH_SHA1, part, npart, &ex);
-			camel_object_unref(cipher);
+			cipher = mail_crypto_get_pgp_cipher_context (account);
+			camel_cipher_sign (cipher, pgp_userid, CAMEL_CIPHER_HASH_SHA1, part, npart, &ex);
+			camel_object_unref (cipher);
 
-			if (camel_exception_is_set(&ex)) {
-				camel_object_unref(npart);
+			if (camel_exception_is_set (&ex)) {
+				camel_object_unref (npart);
 				goto exception;
 			}
 
-			camel_object_unref(part);
+			camel_object_unref (part);
 			part = npart;
 		}
 
 		if (p->pgp_encrypt) {
-			CamelMimePart *npart = camel_mime_part_new();
+			CamelMimePart *npart = camel_mime_part_new ();
 
 			/* check to see if we should encrypt to self, NB gets removed immediately after use */
 			if (account && account->pgp_encrypt_to_self && pgp_userid)
 				g_ptr_array_add (recipients, g_strdup (pgp_userid));
 
 			cipher = mail_crypto_get_pgp_cipher_context (account);
-			camel_cipher_encrypt(cipher, pgp_userid, recipients, part, npart, &ex);
+			camel_cipher_encrypt (cipher, pgp_userid, recipients, part, npart, &ex);
 			camel_object_unref (cipher);
 
 			if (account && account->pgp_encrypt_to_self && pgp_userid)
-				g_ptr_array_set_size(recipients, recipients->len - 1);
+				g_ptr_array_set_size (recipients, recipients->len - 1);
 
 			if (camel_exception_is_set (&ex)) {
-				camel_object_unref(npart);
+				camel_object_unref (npart);
 				goto exception;
 			}
 
@@ -1010,80 +994,80 @@
 		CamelInternetAddress *from = NULL;
 		CamelCipherContext *cipher;
 
-		part = camel_mime_part_new();
-		camel_medium_set_content_object((CamelMedium *)part, current);
+		part = camel_mime_part_new ();
+		camel_medium_set_content_object ((CamelMedium *)part, current);
 		if (current == plain)
-			camel_mime_part_set_encoding(part, plain_encoding);
-		camel_object_unref(current);
+			camel_mime_part_set_encoding (part, plain_encoding);
+		camel_object_unref (current);
 
 		if (p->smime_sign
 		    && (account == NULL || account->smime_sign_key == NULL || account->smime_sign_key[0] == 0)) {
 			camel_exception_set (&ex, CAMEL_EXCEPTION_SYSTEM,
-					     _("Cannot sign outgoing message: No signing certificate set for this account"));
+					     _ ("Cannot sign outgoing message: No signing certificate set for this account"));
 			goto exception;
 		}
 
 		if (p->smime_encrypt
 		    && (account == NULL || account->smime_sign_key == NULL || account->smime_sign_key[0] == 0)) {
 			camel_exception_set (&ex, CAMEL_EXCEPTION_SYSTEM,
-					     _("Cannot encrypt outgoing message: No encryption certificate set for this account"));
+					     _ ("Cannot encrypt outgoing message: No encryption certificate set for this account"));
 			goto exception;
 		}
 
 		if (p->smime_sign) {
-			CamelMimePart *npart = camel_mime_part_new();
+			CamelMimePart *npart = camel_mime_part_new ();
 
-			cipher = camel_smime_context_new(session);
+			cipher = camel_smime_context_new (session);
 
 			/* if we're also encrypting, envelope-sign rather than clear-sign */
 			if (p->smime_encrypt) {
-				camel_smime_context_set_sign_mode((CamelSMIMEContext *)cipher, CAMEL_SMIME_SIGN_ENVELOPED);
-				camel_smime_context_set_encrypt_key((CamelSMIMEContext *)cipher, TRUE, account->smime_encrypt_key);
+				camel_smime_context_set_sign_mode ((CamelSMIMEContext *)cipher, CAMEL_SMIME_SIGN_ENVELOPED);
+				camel_smime_context_set_encrypt_key ((CamelSMIMEContext *)cipher, TRUE, account->smime_encrypt_key);
 			} else if (account && account->smime_encrypt_key && *account->smime_encrypt_key) {
-				camel_smime_context_set_encrypt_key((CamelSMIMEContext *)cipher, TRUE, account->smime_encrypt_key);
+				camel_smime_context_set_encrypt_key ((CamelSMIMEContext *)cipher, TRUE, account->smime_encrypt_key);
 			}
 
-			camel_cipher_sign(cipher, account->smime_sign_key, CAMEL_CIPHER_HASH_SHA1, part, npart, &ex);
-			camel_object_unref(cipher);
+			camel_cipher_sign (cipher, account->smime_sign_key, CAMEL_CIPHER_HASH_SHA1, part, npart, &ex);
+			camel_object_unref (cipher);
 
-			if (camel_exception_is_set(&ex)) {
-				camel_object_unref(npart);
+			if (camel_exception_is_set (&ex)) {
+				camel_object_unref (npart);
 				goto exception;
 			}
 
-			camel_object_unref(part);
+			camel_object_unref (part);
 			part = npart;
 		}
 
 		if (p->smime_encrypt) {
 			/* check to see if we should encrypt to self, NB removed after use */
 			if (account->smime_encrypt_to_self)
-				g_ptr_array_add(recipients, g_strdup (account->smime_encrypt_key));
+				g_ptr_array_add (recipients, g_strdup (account->smime_encrypt_key));
 
-			cipher = camel_smime_context_new(session);
-			camel_smime_context_set_encrypt_key((CamelSMIMEContext *)cipher, TRUE, account->smime_encrypt_key);
+			cipher = camel_smime_context_new (session);
+			camel_smime_context_set_encrypt_key ((CamelSMIMEContext *)cipher, TRUE, account->smime_encrypt_key);
 
-			camel_cipher_encrypt(cipher, NULL, recipients, part, (CamelMimePart *)new, &ex);
-			camel_object_unref(cipher);
+			camel_cipher_encrypt (cipher, NULL, recipients, part, (CamelMimePart *)new, &ex);
+			camel_object_unref (cipher);
 
-			if (camel_exception_is_set(&ex))
+			if (camel_exception_is_set (&ex))
 				goto exception;
 
 			if (account->smime_encrypt_to_self)
-				g_ptr_array_set_size(recipients, recipients->len - 1);
+				g_ptr_array_set_size (recipients, recipients->len - 1);
 		}
 
 		if (from)
-			camel_object_unref(from);
+			camel_object_unref (from);
 
 		/* we replaced the message directly, we don't want to do reparenting foo */
 		if (p->smime_encrypt) {
-			camel_object_unref(part);
+			camel_object_unref (part);
 			goto skip_content;
 		} else {
-			current = camel_medium_get_content_object((CamelMedium *)part);
-			camel_object_ref(current);
-			camel_object_unref(part);
+			current = camel_medium_get_content_object ((CamelMedium *)part);
+			camel_object_ref (current);
+			camel_object_unref (part);
 		}
 	}
 #endif /* HAVE_NSS */
@@ -1098,8 +1082,8 @@
 #endif
 	if (recipients) {
 		for (i=0; i<recipients->len; i++)
-			g_free(recipients->pdata[i]);
-		g_ptr_array_free(recipients, TRUE);
+			g_free (recipients->pdata[i]);
+		g_ptr_array_free (recipients, TRUE);
 	}
 
 	/* Attach whether this message was written in HTML */
@@ -1116,39 +1100,39 @@
 	camel_object_unref (new);
 
 	if (ex.id != CAMEL_EXCEPTION_USER_CANCEL) {
-		e_error_run((GtkWindow *)composer, "mail-composer:no-build-message",
-			    camel_exception_get_description(&ex), NULL);
+		e_error_run ((GtkWindow *)composer, "mail-composer:no-build-message",
+			    camel_exception_get_description (&ex), NULL);
 	}
 
 	camel_exception_clear (&ex);
 
 	if (recipients) {
 		for (i=0; i<recipients->len; i++)
-			g_free(recipients->pdata[i]);
-		g_ptr_array_free(recipients, TRUE);
+			g_free (recipients->pdata[i]);
+		g_ptr_array_free (recipients, TRUE);
 	}
 
 	return NULL;
 }
 
 
-static char *
-get_file_content (EMsgComposer *composer, const char *file_name, gboolean want_html, guint flags, gboolean warn)
+static gchar *
+get_file_content (EMsgComposer *composer, const gchar *file_name, gboolean want_html, guint flags, gboolean warn)
 {
 	CamelStreamFilter *filtered_stream;
 	CamelStreamMem *memstream;
 	CamelMimeFilter *html, *charenc;
 	CamelStream *stream;
 	GByteArray *buffer;
-	char *charset;
-	char *content;
-	int fd;
+	gchar *charset;
+	gchar *content;
+	gint fd;
 
 	fd = g_open (file_name, O_RDONLY, 0);
 	if (fd == -1) {
 		if (warn)
-			e_error_run((GtkWindow *)composer, "mail-composer:no-sig-file",
-				    file_name, g_strerror(errno), NULL);
+			e_error_run ((GtkWindow *)composer, "mail-composer:no-sig-file",
+				    file_name, g_strerror (errno), NULL);
 		return g_strdup ("");
 	}
 
@@ -1210,8 +1194,8 @@
 	return content;
 }
 
-char *
-e_msg_composer_get_sig_file_content (const char *sigfile, gboolean in_html)
+gchar *
+e_msg_composer_get_sig_file_content (const gchar *sigfile, gboolean in_html)
 {
 	if (!sigfile || !*sigfile) {
 		return NULL;
@@ -1333,7 +1317,7 @@
 	g_return_val_if_fail (composer != NULL, g_object_get_data ((GObject *) composer, "attach_path"));
 
 	if (composer->priv->eeditor_engine) {
-		char *str;
+		gchar *str;
 		CORBA_Environment ev;
 
 		CORBA_exception_init (&ev);
@@ -1350,12 +1334,12 @@
 	return g_object_get_data ((GObject *) composer, "attach_path");
 }
 
-static char *
-encode_signature_name (const char *name)
+static gchar *
+encode_signature_name (const gchar *name)
 {
-	const char *s;
-	char *ename, *e;
-	int len = 0;
+	const gchar *s;
+	gchar *ename, *e;
+	gint len = 0;
 
 	s = name;
 	while (*s) {
@@ -1395,12 +1379,12 @@
 	return ename;
 }
 
-static char *
-decode_signature_name (const char *name)
+static gchar *
+decode_signature_name (const gchar *name)
 {
-	const char *s;
-	char *dname, *d;
-	int len = 0;
+	const gchar *s;
+	gchar *dname, *d;
+	gint len = 0;
 
 	s = name;
 	while (*s) {
@@ -1442,11 +1426,11 @@
 
 #define CONVERT_SPACES CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
 
-static char *
+static gchar *
 get_signature_html (EMsgComposer *composer)
 {
 	EComposerHeaderTable *table;
-	char *text = NULL, *html = NULL;
+	gchar *text = NULL, *html = NULL;
 	ESignature *signature;
 	gboolean format_html;
 
@@ -1469,9 +1453,9 @@
 		}
 	} else {
 		EAccountIdentity *id;
-		char *organization;
-		char *address;
-		char *name;
+		gchar *organization;
+		gchar *address;
+		gchar *name;
 
 		id = e_composer_header_table_get_account (table)->id;
 		address = id->address ? camel_text_to_html (id->address, CONVERT_SPACES, 0) : NULL;
@@ -1495,7 +1479,7 @@
 
 	/* printf ("text: %s\n", text); */
 	if (text) {
-		char *encoded_uid = NULL;
+		gchar *encoded_uid = NULL;
 
 		if (signature)
 			encoded_uid = encode_signature_name (signature->uid);
@@ -1511,7 +1495,7 @@
 					"</TD></TR></TABLE>",
 				        encoded_uid ? encoded_uid : "",
 					format_html ? "" : "<PRE>\n",
-					format_html || (!strncmp ("-- \n", text, 4) || strstr(text, "\n-- \n")) ? "" : "-- \n",
+					format_html || (!strncmp ("-- \n", text, 4) || strstr (text, "\n-- \n")) ? "" : "-- \n",
 					text,
 					format_html ? "" : "</PRE>\n");
 		g_free (text);
@@ -1523,7 +1507,7 @@
 }
 
 static void
-set_editor_text(EMsgComposer *composer, const char *text, ssize_t len, int set_signature, int pad_signature)
+set_editor_text (EMsgComposer *composer, const gchar *text, ssize_t len, gint set_signature, gint pad_signature)
 {
 	EMsgComposerPrivate *p = composer->priv;
 	Bonobo_PersistStream persist;
@@ -1531,7 +1515,7 @@
 	CORBA_Environment ev;
 	Bonobo_Unknown object;
 	gboolean reply_signature_on_top;
-	char *body = NULL, *html = NULL;
+	gchar *body = NULL, *html = NULL;
 	GConfClient *gconf;
 
 	g_return_if_fail (p->persist_stream_interface != CORBA_OBJECT_NIL);
@@ -1561,7 +1545,7 @@
 	g_object_unref (gconf);
 
 	if (set_signature && reply_signature_on_top) {
-		char *tmp = NULL;
+		gchar *tmp = NULL;
 		tmp = get_signature_html (composer);
 		if (tmp) {
 			/* Minimizing the damage. Make it just a part of the body instead of a signature */
@@ -1582,7 +1566,7 @@
 					"<TABLE WIDTH=\"100%%\" CELLSPACING=\"0\" CELLPADDING=\"0\"><TR><TD> </TD></TR></TABLE>%s", text);
 		}
 	} else {
-		body = g_strdup(text);
+		body = g_strdup (text);
 	}
 
 	if (body) {
@@ -1618,30 +1602,30 @@
 	e_expander_set_expanded (E_EXPANDER (p->attachment_expander), show);
 	if (show)
 		gtk_label_set_text_with_mnemonic (GTK_LABEL (composer->priv->attachment_expander_label),
-		_("Hide _Attachment Bar"));
+		_ ("Hide _Attachment Bar"));
 	else
 		gtk_label_set_text_with_mnemonic (GTK_LABEL (composer->priv->attachment_expander_label),
-		_("Show _Attachment Bar"));
+		_ ("Show _Attachment Bar"));
 }
 
 static void
-save (EMsgComposer *composer, const char *filename)
+save (EMsgComposer *composer, const gchar *filename)
 {
 	EMsgComposerPrivate *p = composer->priv;
 	CORBA_Environment ev;
-	int fd;
+	gint fd;
 
 	/* check to see if we already have the file and that we can create it */
 	if ((fd = g_open (filename, O_RDONLY | O_CREAT | O_EXCL, 0777)) == -1) {
-		int resp, errnosav = errno;
+		gint resp, errnosav = errno;
 		struct stat st;
 
 		if (g_stat (filename, &st) == 0 && S_ISREG (st.st_mode)) {
-			resp = e_error_run((GtkWindow *)composer, E_ERROR_ASK_FILE_EXISTS_OVERWRITE, filename, NULL);
+			resp = e_error_run ((GtkWindow *)composer, E_ERROR_ASK_FILE_EXISTS_OVERWRITE, filename, NULL);
 			if (resp != GTK_RESPONSE_OK)
 				return;
 		} else {
-			e_error_run((GtkWindow *)composer, E_ERROR_NO_SAVE_FILE, filename, g_strerror(errnosav));
+			e_error_run ((GtkWindow *)composer, E_ERROR_NO_SAVE_FILE, filename, g_strerror (errnosav));
 			return;
 		}
 	} else
@@ -1652,8 +1636,8 @@
 	Bonobo_PersistFile_save (p->persist_file_interface, filename, &ev);
 
 	if (ev._major != CORBA_NO_EXCEPTION) {
-		e_error_run((GtkWindow *)composer, E_ERROR_NO_SAVE_FILE,
-			    filename, _("Unknown reason"));
+		e_error_run ((GtkWindow *)composer, E_ERROR_NO_SAVE_FILE,
+			    filename, _ ("Unknown reason"));
 	} else {
 		GNOME_GtkHTML_Editor_Engine_runCommand (p->eeditor_engine, "saved", &ev);
 		e_msg_composer_unset_autosaved (composer);
@@ -1662,21 +1646,21 @@
 }
 
 static void
-saveas_response(EMsgComposer *composer, const char *name)
+saveas_response (EMsgComposer *composer, const gchar *name)
 {
-	save(composer, name);
+	save (composer, name);
 }
 
 static void
-saveas(EMsgComposer *composer)
+saveas (EMsgComposer *composer)
 {
 	EMsgComposerPrivate *p = composer->priv;
 
-	e_msg_composer_select_file (composer, &p->saveas, saveas_response, _("Save as..."), TRUE);
+	e_msg_composer_select_file (composer, &p->saveas, saveas_response, _ ("Save as..."), TRUE);
 }
 
 static void
-load (EMsgComposer *composer, const char *file_name)
+load (EMsgComposer *composer, const gchar *file_name)
 {
 	EMsgComposerPrivate *p = composer->priv;
 	CORBA_Environment ev;
@@ -1686,8 +1670,8 @@
 	Bonobo_PersistFile_load (p->persist_file_interface, file_name, &ev);
 
 	if (ev._major != CORBA_NO_EXCEPTION)
-		e_error_run((GtkWindow *)composer, E_ERROR_NO_LOAD_FILE,
-			    file_name, _("Unknown reason"), NULL);
+		e_error_run ((GtkWindow *)composer, E_ERROR_NO_LOAD_FILE,
+			    file_name, _ ("Unknown reason"), NULL);
 
 	CORBA_exception_free (&ev);
 }
@@ -1712,8 +1696,8 @@
 	EMsgComposerPrivate *p = composer->priv;
 	CamelMimeMessage *message;
 	CamelStream *stream;
-	char *file;
-	int fd, camelfd;
+	gchar *file;
+	gint fd, camelfd;
 	gboolean success = TRUE;
 
 	if (!e_msg_composer_is_dirty (composer))
@@ -1724,25 +1708,25 @@
 
 	if (fd == -1) {
 		/* This code is odd, the fd is opened elsewhere but a failure is ignored */
-		e_error_run((GtkWindow *)composer, "mail-composer:no-autosave",
-			    file, _("Could not open file"), NULL);
+		e_error_run ((GtkWindow *)composer, "mail-composer:no-autosave",
+			    file, _ ("Could not open file"), NULL);
 		return FALSE;
 	}
 
 	message = e_msg_composer_get_message_draft (composer);
 
 	if (message == NULL) {
-		e_error_run((GtkWindow *)composer, "mail-composer:no-autosave",
-			    file, _("Unable to retrieve message from editor"), NULL);
+		e_error_run ((GtkWindow *)composer, "mail-composer:no-autosave",
+			    file, _ ("Unable to retrieve message from editor"), NULL);
 		return FALSE;
 	}
 
 	if (lseek (fd, (off_t)0, SEEK_SET) == -1
 	    || ftruncate (fd, (off_t)0) == -1
-	    || (camelfd = dup(fd)) == -1) {
+	    || (camelfd = dup (fd)) == -1) {
 		camel_object_unref (message);
-		e_error_run((GtkWindow *)composer, "mail-composer:no-autosave",
-			    file, g_strerror(errno), NULL);
+		e_error_run ((GtkWindow *)composer, "mail-composer:no-autosave",
+			    file, g_strerror (errno), NULL);
 		return FALSE;
 	}
 
@@ -1750,8 +1734,8 @@
 	stream = camel_stream_fs_new_with_fd (camelfd);
 	if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream) == -1
 	    || camel_stream_close (CAMEL_STREAM (stream)) == -1) {
-		e_error_run((GtkWindow *)composer, "mail-composer:no-autosave",
-			    file, g_strerror(errno), NULL);
+		e_error_run ((GtkWindow *)composer, "mail-composer:no-autosave",
+			    file, g_strerror (errno), NULL);
 		success = FALSE;
 	} else {
 		CORBA_Environment ev;
@@ -1770,7 +1754,7 @@
 }
 
 static EMsgComposer *
-autosave_load_draft (const char *filename)
+autosave_load_draft (const gchar *filename)
 {
 	CamelStream *stream;
 	CamelMimeMessage *msg;
@@ -1805,7 +1789,7 @@
 }
 
 static gboolean
-autosave_is_owned (AutosaveManager *am, const char *file)
+autosave_is_owned (AutosaveManager *am, const gchar *file)
 {
 	return g_hash_table_lookup (am->table, file) != NULL;
 }
@@ -1814,7 +1798,7 @@
 autosave_manager_query_load_orphans (AutosaveManager *am, GtkWindow *parent)
 {
 	GDir *dir;
-	const char *dname;
+	const gchar *dname;
 	GSList *match = NULL;
 	gint len = strlen (AUTOSAVE_SEED);
 	gint load = FALSE;
@@ -1852,11 +1836,11 @@
 	g_free (dirname);
 
 	if (match != NULL)
-		load = e_error_run(parent, "mail-composer:recover-autosave", NULL) == GTK_RESPONSE_YES;
+		load = e_error_run (parent, "mail-composer:recover-autosave", NULL) == GTK_RESPONSE_YES;
 
 	while (match != NULL) {
 		GSList *next = match->next;
-		char *filename = match->data;
+		gchar *filename = match->data;
 		EMsgComposer *composer;
 
 		if (load) {
@@ -1946,7 +1930,7 @@
 static void
 autosave_manager_register (AutosaveManager *am, EMsgComposer *composer)
 {
-	char *key;
+	gchar *key;
 	EMsgComposerPrivate *p = composer->priv;
 
 	g_return_if_fail (composer != NULL);
@@ -1994,7 +1978,7 @@
 }
 
 static void
-menu_file_save_draft_cb (BonoboUIComponent *uic, void *data, const char *path)
+menu_file_save_draft_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
 {
 	g_signal_emit (data, signals[SAVE_DRAFT], 0, FALSE);
 	e_msg_composer_unset_changed (E_MSG_COMPOSER (data));
@@ -2007,8 +1991,8 @@
 do_exit (EMsgComposer *composer)
 {
 	EComposerHeaderTable *table;
-	const char *subject;
-	int button;
+	const gchar *subject;
+	gint button;
 
 	if (!e_msg_composer_is_dirty (composer) && !e_msg_composer_is_autosaved (composer)) {
 		gtk_widget_destroy (GTK_WIDGET (composer));
@@ -2020,8 +2004,8 @@
 	table = e_msg_composer_get_header_table (composer);
 	subject = e_composer_header_table_get_subject (table);
 
-	button = e_error_run((GtkWindow *)composer, "mail-composer:exit-unsaved",
-			     subject && subject[0] ? subject : _("Untitled Message"), NULL);
+	button = e_error_run ((GtkWindow *)composer, "mail-composer:exit-unsaved",
+			     subject && subject[0] ? subject : _ ("Untitled Message"), NULL);
 
 	switch (button) {
 	case GTK_RESPONSE_YES:
@@ -2042,28 +2026,28 @@
 
 /* Menu callbacks.  */
 static void
-file_open_response(EMsgComposer *composer, const char *name)
+file_open_response (EMsgComposer *composer, const gchar *name)
 {
 	load (composer, name);
 }
 
 static void
 menu_file_open_cb (BonoboUIComponent *uic,
-		   void *data,
-		   const char *path)
+		   gpointer data,
+		   const gchar *path)
 {
-	EMsgComposer *composer = E_MSG_COMPOSER(data);
+	EMsgComposer *composer = E_MSG_COMPOSER (data);
 	EMsgComposerPrivate *p = composer->priv;
 
 	/* NB: This function is never used anymore */
 
-	e_msg_composer_select_file(composer, &p->load, file_open_response, _("Open File"), FALSE);
+	e_msg_composer_select_file (composer, &p->load, file_open_response, _ ("Open File"), FALSE);
 }
 
 static void
 menu_file_save_cb (BonoboUIComponent *uic,
-		   void *data,
-		   const char *path)
+		   gpointer data,
+		   const gchar *path)
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (data);
 	EMsgComposerPrivate *p = composer->priv;
@@ -2085,24 +2069,24 @@
 
 static void
 menu_file_save_as_cb (BonoboUIComponent *uic,
-		      void *data,
-		      const char *path)
+		      gpointer data,
+		      const gchar *path)
 {
-	saveas (E_MSG_COMPOSER(data));
+	saveas (E_MSG_COMPOSER (data));
 }
 
 static void
 menu_file_send_cb (BonoboUIComponent *uic,
-		   void *data,
-		   const char *path)
+		   gpointer data,
+		   const gchar *path)
 {
 	g_signal_emit (GTK_OBJECT (data), signals[SEND], 0);
 }
 
 static void
 menu_file_close_cb (BonoboUIComponent *uic,
-		    void *data,
-		    const char *path)
+		    gpointer data,
+		    const gchar *path)
 {
 	EMsgComposer *composer;
 
@@ -2113,8 +2097,8 @@
 /* this is the callback for the help menu */
 static void
 menu_help_cb (BonoboUIComponent *uic,
-	      void *data,
-	      const char *path)
+	      gpointer data,
+	      const gchar *path)
 {
 	EMsgComposer *composer = (EMsgComposer *) data;
 
@@ -2123,7 +2107,7 @@
 
 
 static void
-add_to_bar (EMsgComposer *composer, GSList *names, int is_inline)
+add_to_bar (EMsgComposer *composer, GSList *names, gint is_inline)
 {
 	EMsgComposerPrivate *p = composer->priv;
 
@@ -2134,7 +2118,7 @@
 			continue;
 
 		if (!g_ascii_strcasecmp (url->protocol, "file")) {
-			e_attachment_bar_attach((EAttachmentBar *)p->attachment_bar, url->path, is_inline ? "inline" : "attachment");
+			e_attachment_bar_attach ((EAttachmentBar *)p->attachment_bar, url->path, is_inline ? "inline" : "attachment");
 		} else {
 			e_attachment_bar_attach_remote_file ((EAttachmentBar *)p->attachment_bar, names->data, is_inline ? "inline" : "attachment");
 		}
@@ -2146,19 +2130,19 @@
 
 static void
 menu_file_add_attachment_cb (BonoboUIComponent *uic,
-			     void *data,
-			     const char *path)
+			     gpointer data,
+			     const gchar *path)
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (data);
 	EMsgComposerPrivate *p = composer->priv;
 	EMsgComposer *toplevel = E_MSG_COMPOSER (gtk_widget_get_toplevel (GTK_WIDGET (p->attachment_bar)));
-	GtkWidget **attachment_selector = e_attachment_bar_get_selector(E_ATTACHMENT_BAR(p->attachment_bar));
+	GtkWidget **attachment_selector = e_attachment_bar_get_selector (E_ATTACHMENT_BAR (p->attachment_bar));
 
 	e_msg_composer_select_file_attachments (toplevel, attachment_selector, add_to_bar);
 }
 
 static void
-menu_edit_cut_cb (BonoboUIComponent *uic, void *data, const char *path)
+menu_edit_cut_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
 {
 	EMsgComposer *composer = data;
 	EMsgComposerPrivate *p = composer->priv;
@@ -2174,7 +2158,7 @@
 }
 
 static void
-menu_edit_copy_cb (BonoboUIComponent *uic, void *data, const char *path)
+menu_edit_copy_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
 {
 	EMsgComposer *composer = data;
 	EMsgComposerPrivate *p = composer->priv;
@@ -2190,7 +2174,7 @@
 }
 
 static void
-menu_edit_paste_cb (BonoboUIComponent *uic, void *data, const char *path)
+menu_edit_paste_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
 {
 	EMsgComposer *composer = data;
 	EMsgComposerPrivate *p = composer->priv;
@@ -2206,22 +2190,22 @@
 }
 
 static void
-menu_send_options_cb (BonoboUIComponent *component, void *data, const char *path)
+menu_send_options_cb (BonoboUIComponent *component, gpointer data, const gchar *path)
 {
-	EMEvent *e = em_event_peek();
+	EMEvent *e = em_event_peek ();
 	EMEventTargetComposer  *target;
 	EMsgComposer *composer = data;
 
 	target = em_event_target_new_composer (e, composer, EM_EVENT_COMPOSER_SEND_OPTION);
 	e_msg_composer_set_send_options (composer, FALSE);
-	e_event_emit((EEvent *)e, "composer.selectsendoption", (EEventTarget *)target);
+	e_event_emit ((EEvent *)e, "composer.selectsendoption", (EEventTarget *)target);
 	if (!composer->priv->send_invoked) {
 		e_error_run ((GtkWindow *)composer, "mail-composer:send-options-support", NULL);
 	}
 }
 
 static void
-menu_edit_select_all_cb (BonoboUIComponent *uic, void *data, const char *path)
+menu_edit_select_all_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
 {
 	EMsgComposer *composer = data;
 	EMsgComposerPrivate *p = composer->priv;
@@ -2238,7 +2222,7 @@
 }
 
 static void
-menu_edit_delete_all_cb (BonoboUIComponent *uic, void *data, const char *path)
+menu_edit_delete_all_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (data);
 	EMsgComposerPrivate *p = composer->priv;
@@ -2269,9 +2253,9 @@
 
 static void
 menu_format_html_cb (BonoboUIComponent           *component,
-		     const char                  *path,
+		     const gchar                  *path,
 		     Bonobo_UIComponent_EventType type,
-		     const char                  *state,
+		     const gchar                  *state,
 		     gpointer                     user_data)
 
 {
@@ -2283,9 +2267,9 @@
 
 static void
 menu_security_pgp_sign_cb (BonoboUIComponent           *component,
-			   const char                  *path,
+			   const gchar                  *path,
 			   Bonobo_UIComponent_EventType type,
-			   const char                  *state,
+			   const gchar                  *state,
 			   gpointer                     composer)
 
 {
@@ -2297,9 +2281,9 @@
 
 static void
 menu_security_pgp_encrypt_cb (BonoboUIComponent           *component,
-			      const char                  *path,
+			      const gchar                  *path,
 			      Bonobo_UIComponent_EventType type,
-			      const char                  *state,
+			      const gchar                  *state,
 			      gpointer                     composer)
 
 {
@@ -2311,9 +2295,9 @@
 
 static void
 menu_security_smime_sign_cb (BonoboUIComponent           *component,
-			     const char                  *path,
+			     const gchar                  *path,
 			     Bonobo_UIComponent_EventType type,
-			     const char                  *state,
+			     const gchar                  *state,
 			     gpointer                     composer)
 
 {
@@ -2325,9 +2309,9 @@
 
 static void
 menu_security_smime_encrypt_cb (BonoboUIComponent           *component,
-				const char                  *path,
+				const gchar                  *path,
 				Bonobo_UIComponent_EventType type,
-				const char                  *state,
+				const gchar                  *state,
 				gpointer                     composer)
 
 {
@@ -2340,9 +2324,9 @@
 
 static void
 menu_view_from_cb (BonoboUIComponent           *component,
-		   const char                  *path,
+		   const gchar                  *path,
 		   Bonobo_UIComponent_EventType type,
-		   const char                  *state,
+		   const gchar                  *state,
 		   gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2353,9 +2337,9 @@
 
 static void
 menu_view_replyto_cb (BonoboUIComponent           *component,
-		      const char                  *path,
+		      const gchar                  *path,
 		      Bonobo_UIComponent_EventType type,
-		      const char                  *state,
+		      const gchar                  *state,
 		      gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2366,9 +2350,9 @@
 
 static void
 menu_view_to_cb (BonoboUIComponent           *component,
-		      const char                  *path,
+		      const gchar                  *path,
 		      Bonobo_UIComponent_EventType type,
-		      const char                  *state,
+		      const gchar                  *state,
 		      gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2379,9 +2363,9 @@
 
 static void
 menu_view_postto_cb (BonoboUIComponent           *component,
-		      const char                  *path,
+		      const gchar                  *path,
 		      Bonobo_UIComponent_EventType type,
-		      const char                  *state,
+		      const gchar                  *state,
 		      gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2392,9 +2376,9 @@
 
 static void
 menu_view_cc_cb (BonoboUIComponent           *component,
-		 const char                  *path,
+		 const gchar                  *path,
 		 Bonobo_UIComponent_EventType type,
-		 const char                  *state,
+		 const gchar                  *state,
 		 gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2405,9 +2389,9 @@
 
 static void
 menu_view_bcc_cb (BonoboUIComponent           *component,
-		  const char                  *path,
+		  const gchar                  *path,
 		  Bonobo_UIComponent_EventType type,
-		  const char                  *state,
+		  const gchar                  *state,
 		  gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2418,9 +2402,9 @@
 
 static void
 menu_insert_receipt_cb (BonoboUIComponent           *component,
-			const char                  *path,
+			const gchar                  *path,
 			Bonobo_UIComponent_EventType type,
-			const char                  *state,
+			const gchar                  *state,
 			gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2431,9 +2415,9 @@
 
 static void
 menu_insert_priority_cb (BonoboUIComponent           *component,
-			const char                  *path,
+			const gchar                  *path,
 			Bonobo_UIComponent_EventType type,
-			const char                  *state,
+			const gchar                  *state,
 			gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2444,9 +2428,9 @@
 
 static void
 menu_changed_charset_cb (BonoboUIComponent           *component,
-			 const char                  *path,
+			 const gchar                  *path,
 			 Bonobo_UIComponent_EventType type,
-			 const char                  *state,
+			 const gchar                  *state,
 			 gpointer                     user_data)
 {
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
@@ -2503,8 +2487,8 @@
 	EMsgComposerPrivate *p = composer->priv;
 	BonoboUIContainer *container;
 	gboolean hide_smime;
-	char *charset;
-	char *xmlfile;
+	gchar *charset;
+	gchar *xmlfile;
 
 	container = bonobo_window_get_ui_container (BONOBO_WINDOW (composer));
 
@@ -2631,7 +2615,7 @@
 		p->uic, "SecurityPGPEncrypt",
 		menu_security_pgp_encrypt_cb, composer);
 
-#if defined(HAVE_NSS) && defined(SMIME_SUPPORTED)
+#if defined (HAVE_NSS) && defined (SMIME_SUPPORTED)
 	hide_smime = FALSE;
 #else
 	hide_smime = TRUE;
@@ -2668,9 +2652,9 @@
 	p->entry_uic = bonobo_ui_component_new_default ();
 
 	/* Setup main menu plugin mechanism */
-	target = em_menu_target_new_widget(p->menu, (GtkWidget *)composer);
-	e_menu_update_target((EMenu *)p->menu, target);
-	e_menu_activate((EMenu *)p->menu, p->uic, TRUE);
+	target = em_menu_target_new_widget (p->menu, (GtkWidget *)composer);
+	e_menu_update_target ((EMenu *)p->menu, target);
+	e_menu_activate ((EMenu *)p->menu, p->uic, TRUE);
 }
 
 
@@ -2678,7 +2662,7 @@
 
 static void
 attachment_bar_changed_cb (EAttachmentBar *bar,
-			   void *data)
+			   gpointer data)
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (data);
 	EMsgComposerPrivate *p = composer->priv;
@@ -2716,10 +2700,10 @@
 	/* Update the expander label */
 	if (show)
 		gtk_label_set_text_with_mnemonic (GTK_LABEL (composer->priv->attachment_expander_label),
-		_("Hide _Attachment Bar"));
+		_ ("Hide _Attachment Bar"));
 	else
 		gtk_label_set_text_with_mnemonic (GTK_LABEL (composer->priv->attachment_expander_label),
-		_("Show _Attachment Bar"));
+		_ ("Show _Attachment Bar"));
  }
 static void
 subject_changed_cb (EMsgComposer *composer)
@@ -2731,7 +2715,7 @@
 	subject = e_composer_header_table_get_subject (table);
 
 	if (subject == NULL || *subject == '\0')
-		subject = _("Compose Message");
+		subject = _ ("Compose Message");
 
 	gtk_window_set_title (GTK_WINDOW (composer), subject);
 }
@@ -2742,12 +2726,12 @@
 };
 
 static void
-update_auto_recipients (EComposerHeaderTable *table, int mode, const char *auto_addrs)
+update_auto_recipients (EComposerHeaderTable *table, gint mode, const gchar *auto_addrs)
 {
 	EDestination *dest, **destv = NULL;
 	CamelInternetAddress *iaddr;
 	GList *list, *tail, *node;
-	int i, n = 0;
+	gint i, n = 0;
 
 	tail = list = NULL;
 
@@ -2755,7 +2739,7 @@
 		iaddr = camel_internet_address_new ();
 		if (camel_address_decode (CAMEL_ADDRESS (iaddr), auto_addrs) != -1) {
 			for (i = 0; i < camel_address_length (CAMEL_ADDRESS (iaddr)); i++) {
-				const char *name, *addr;
+				const gchar *name, *addr;
 
 				if (!camel_internet_address_get (iaddr, i, &name, &addr))
 					continue;
@@ -2872,13 +2856,13 @@
 /* GObject methods.  */
 
 static void
-composer_finalise (GObject *object)
+msg_composer_finalize (GObject *object)
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (object);
 	EMsgComposerPrivate *p = composer->priv;
 
 	if (p->extra_hdr_names) {
-		int i;
+		gint i;
 
 		for (i = 0; i < p->extra_hdr_names->len; i++) {
 			g_free (p->extra_hdr_names->pdata[i]);
@@ -2898,32 +2882,26 @@
 	if (p->redirect)
 		camel_object_unref (p->redirect);
 
-
-	g_free (p);
-
-	p = NULL;
-	composer->priv = NULL;
-
-	if (G_OBJECT_CLASS (parent_class)->finalize != NULL)
-		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
+	/* Chain up to parent's finalize () method. */
+	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void
-composer_dispose(GObject *object)
+msg_composer_dispose (GObject *object)
 {
-	/* When destroy() is called, the contents of the window
+	/* When destroy () is called, the contents of the window
 	 * (including the remote editor control) will already have
 	 * been destroyed, so we have to do this here.
 	 */
 	autosave_manager_unregister (am, E_MSG_COMPOSER (object));
 
-	if (G_OBJECT_CLASS (parent_class)->dispose != NULL)
-		(* G_OBJECT_CLASS (parent_class)->dispose) (object);
+	/* Chain up to parent's dispose () method. */
+	G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 /* GtkObject methods */
 static void
-destroy (GtkObject *object)
+msg_composer_destroy (GtkObject *object)
 {
 	EMsgComposer *composer = (EMsgComposer *)object;
 	EMsgComposerPrivate *p = composer->priv;
@@ -2932,18 +2910,18 @@
 	CORBA_exception_init (&ev);
 
 	if (p->menu) {
-		e_menu_update_target((EMenu *)p->menu, NULL);
-		g_object_unref(p->menu);
+		e_menu_update_target ((EMenu *)p->menu, NULL);
+		g_object_unref (p->menu);
 		p->menu = NULL;
 	}
 
 	if (p->load) {
-		gtk_widget_destroy(p->load);
+		gtk_widget_destroy (p->load);
 		p->load = NULL;
 	}
 
 	if (p->saveas) {
-		gtk_widget_destroy(p->saveas);
+		gtk_widget_destroy (p->saveas);
 		p->saveas = NULL;
 	}
 
@@ -3001,8 +2979,8 @@
 		p->eeditor_listener = NULL;
 	}
 
-	if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL)
-		(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+	/* Chain up to parent's destroy () method. */
+	GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
 
 
@@ -3023,9 +3001,9 @@
 
 /* GtkWidget methods.  */
 
-static int
-delete_event (GtkWidget *widget,
-	      GdkEventAny *event)
+static gint
+msg_composer_delete_event (GtkWidget *widget,
+                           GdkEventAny *event)
 {
 	do_exit (E_MSG_COMPOSER (widget));
 
@@ -3033,27 +3011,27 @@
 }
 
 static void
-attach_message(EMsgComposer *composer, CamelMimeMessage *msg)
+attach_message (EMsgComposer *composer, CamelMimeMessage *msg)
 {
 	CamelMimePart *mime_part;
-	const char *subject;
+	const gchar *subject;
 	EMsgComposerPrivate *p = composer->priv;
 
-	mime_part = camel_mime_part_new();
-	camel_mime_part_set_disposition(mime_part, "inline");
-	subject = camel_mime_message_get_subject(msg);
+	mime_part = camel_mime_part_new ();
+	camel_mime_part_set_disposition (mime_part, "inline");
+	subject = camel_mime_message_get_subject (msg);
 	if (subject) {
-		char *desc = g_strdup_printf(_("Attached message - %s"), subject);
+		gchar *desc = g_strdup_printf (_ ("Attached message - %s"), subject);
 
-		camel_mime_part_set_description(mime_part, desc);
-		g_free(desc);
+		camel_mime_part_set_description (mime_part, desc);
+		g_free (desc);
 	} else
-		camel_mime_part_set_description(mime_part, _("Attached message"));
+		camel_mime_part_set_description (mime_part, _ ("Attached message"));
 
-	camel_medium_set_content_object((CamelMedium *)mime_part, (CamelDataWrapper *)msg);
-	camel_mime_part_set_content_type(mime_part, "message/rfc822");
-	e_attachment_bar_attach_mime_part(E_ATTACHMENT_BAR(p->attachment_bar), mime_part);
-	camel_object_unref(mime_part);
+	camel_medium_set_content_object ((CamelMedium *)mime_part, (CamelDataWrapper *)msg);
+	camel_mime_part_set_content_type (mime_part, "message/rfc822");
+	e_attachment_bar_attach_mime_part (E_ATTACHMENT_BAR (p->attachment_bar), mime_part);
+	camel_object_unref (mime_part);
 }
 
 struct _drop_data {
@@ -3067,12 +3045,12 @@
 	guint info;
 	guint time;
 
-	unsigned int move:1;
-	unsigned int moved:1;
-	unsigned int aborted:1;
+	guint move:1;
+	guint moved:1;
+	guint aborted:1;
 };
 
-int
+gint
 e_msg_composer_get_remote_download_count (EMsgComposer *composer)
 {
 	EMsgComposerPrivate *p = composer->priv;
@@ -3081,7 +3059,7 @@
 }
 
 static gchar *
-attachment_guess_mime_type (const char *file_name)
+attachment_guess_mime_type (const gchar *file_name)
 {
 	GnomeVFSFileInfo *info;
 	GnomeVFSResult result;
@@ -3101,36 +3079,36 @@
 }
 
 static void
-drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, GtkSelectionData *selection, guint info, guint time, gboolean html_dnd)
+drop_action (EMsgComposer *composer, GdkDragContext *context, guint32 action, GtkSelectionData *selection, guint info, guint time, gboolean html_dnd)
 {
-	char *tmp, *str, **urls;
+	gchar *tmp, *str, **urls;
 	CamelMimePart *mime_part;
 	CamelStream *stream;
 	CamelMimeMessage *msg;
-	char *content_type;
-	int i, success = FALSE, delete = FALSE;
+	gchar *content_type;
+	gint i, success = FALSE, delete = FALSE;
 	EMsgComposerPrivate *p = composer->priv;
 
 	switch (info) {
 	case DND_TYPE_MESSAGE_RFC822:
-		d(printf ("dropping a message/rfc822\n"));
-		/* write the message(s) out to a CamelStream so we can use it */
+		d (printf ("dropping a message/rfc822\n"));
+		/* write the message (s) out to a CamelStream so we can use it */
 		stream = camel_stream_mem_new ();
 		camel_stream_write (stream, (const gchar *)selection->data, selection->length);
 		camel_stream_reset (stream);
 
 		msg = camel_mime_message_new ();
-		if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) {
-			attach_message(composer, msg);
+		if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)msg, stream) != -1) {
+			attach_message (composer, msg);
 			success = TRUE;
 			delete = action == GDK_ACTION_MOVE;
 		}
 
-		camel_object_unref(msg);
-		camel_object_unref(stream);
+		camel_object_unref (msg);
+		camel_object_unref (stream);
 		break;
 	case DND_TYPE_NETSCAPE_URL:
-		d(printf ("dropping a _NETSCAPE_URL\n"));
+		d (printf ("dropping a _NETSCAPE_URL\n"));
 		tmp = g_strndup ((const gchar *) selection->data, selection->length);
 		urls = g_strsplit (tmp, "\n", 2);
 		g_free (tmp);
@@ -3142,7 +3120,7 @@
 		success = TRUE;
 		break;
 	case DND_TYPE_TEXT_URI_LIST:
-		d(printf ("dropping a text/uri-list\n"));
+		d (printf ("dropping a text/uri-list\n"));
 		tmp = g_strndup ((const gchar *) selection->data, selection->length);
 		urls = g_strsplit (tmp, "\n", 0);
 		g_free (tmp);
@@ -3164,7 +3142,7 @@
 	case DND_TYPE_TEXT_VCARD:
 	case DND_TYPE_TEXT_CALENDAR:
 		content_type = gdk_atom_name (selection->type);
-		d(printf ("dropping a %s\n", content_type));
+		d (printf ("dropping a %s\n", content_type));
 
 		mime_part = camel_mime_part_new ();
 		camel_mime_part_set_content (mime_part, (const gchar *)selection->data, selection->length, content_type);
@@ -3179,146 +3157,146 @@
 		break;
 	case DND_TYPE_X_UID_LIST: {
 		GPtrArray *uids;
-		char *inptr, *inend;
+		gchar *inptr, *inend;
 		CamelFolder *folder;
 		CamelException ex = CAMEL_EXCEPTION_INITIALISER;
 
 		/* NB: This all runs synchronously, could be very slow/hang/block the ui */
 
-		uids = g_ptr_array_new();
+		uids = g_ptr_array_new ();
 
 		inptr = (char*)selection->data;
 		inend = (char*)(selection->data + selection->length);
 		while (inptr < inend) {
-			char *start = inptr;
+			gchar *start = inptr;
 
 			while (inptr < inend && *inptr)
 				inptr++;
 
 			if (start > (char *)selection->data)
-				g_ptr_array_add(uids, g_strndup(start, inptr-start));
+				g_ptr_array_add (uids, g_strndup (start, inptr-start));
 
 			inptr++;
 		}
 
 		if (uids->len > 0) {
-			folder = mail_tool_uri_to_folder((const gchar *)selection->data, 0, &ex);
+			folder = mail_tool_uri_to_folder ((const gchar *)selection->data, 0, &ex);
 			if (folder) {
 				if (uids->len == 1) {
-					msg = camel_folder_get_message(folder, uids->pdata[0], &ex);
+					msg = camel_folder_get_message (folder, uids->pdata[0], &ex);
 					if (msg == NULL)
 						goto fail;
-					attach_message(composer, msg);
+					attach_message (composer, msg);
 				} else {
-					CamelMultipart *mp = camel_multipart_new();
-					char *desc;
+					CamelMultipart *mp = camel_multipart_new ();
+					gchar *desc;
 
-					camel_data_wrapper_set_mime_type((CamelDataWrapper *)mp, "multipart/digest");
-					camel_multipart_set_boundary(mp, NULL);
+					camel_data_wrapper_set_mime_type ((CamelDataWrapper *)mp, "multipart/digest");
+					camel_multipart_set_boundary (mp, NULL);
 					for (i=0;i<uids->len;i++) {
-						msg = camel_folder_get_message(folder, uids->pdata[i], &ex);
+						msg = camel_folder_get_message (folder, uids->pdata[i], &ex);
 						if (msg) {
-							mime_part = camel_mime_part_new();
-							camel_mime_part_set_disposition(mime_part, "inline");
-							camel_medium_set_content_object((CamelMedium *)mime_part, (CamelDataWrapper *)msg);
-							camel_mime_part_set_content_type(mime_part, "message/rfc822");
-							camel_multipart_add_part(mp, mime_part);
-							camel_object_unref(mime_part);
-							camel_object_unref(msg);
+							mime_part = camel_mime_part_new ();
+							camel_mime_part_set_disposition (mime_part, "inline");
+							camel_medium_set_content_object ((CamelMedium *)mime_part, (CamelDataWrapper *)msg);
+							camel_mime_part_set_content_type (mime_part, "message/rfc822");
+							camel_multipart_add_part (mp, mime_part);
+							camel_object_unref (mime_part);
+							camel_object_unref (msg);
 						} else {
-							camel_object_unref(mp);
+							camel_object_unref (mp);
 							goto fail;
 						}
 					}
-					mime_part = camel_mime_part_new();
-					camel_medium_set_content_object((CamelMedium *)mime_part, (CamelDataWrapper *)mp);
+					mime_part = camel_mime_part_new ();
+					camel_medium_set_content_object ((CamelMedium *)mime_part, (CamelDataWrapper *)mp);
 					/* translators, this count will always be >1 */
-					desc = g_strdup_printf(ngettext("Attached message", "%d attached messages", uids->len), uids->len);
-					camel_mime_part_set_description(mime_part, desc);
-					g_free(desc);
-					e_attachment_bar_attach_mime_part(E_ATTACHMENT_BAR(p->attachment_bar), mime_part);
-					camel_object_unref(mime_part);
-					camel_object_unref(mp);
+					desc = g_strdup_printf (ngettext ("Attached message", "%d attached messages", uids->len), uids->len);
+					camel_mime_part_set_description (mime_part, desc);
+					g_free (desc);
+					e_attachment_bar_attach_mime_part (E_ATTACHMENT_BAR (p->attachment_bar), mime_part);
+					camel_object_unref (mime_part);
+					camel_object_unref (mp);
 				}
 				success = TRUE;
 				delete = action == GDK_ACTION_MOVE;
 			fail:
-				if (camel_exception_is_set(&ex)) {
-					char *name;
+				if (camel_exception_is_set (&ex)) {
+					gchar *name;
 
-					camel_object_get(folder, NULL, CAMEL_FOLDER_NAME, &name, NULL);
-					e_error_run((GtkWindow *)composer, "mail-composer:attach-nomessages",
-						    name?name:(char *)selection->data, camel_exception_get_description(&ex), NULL);
-					camel_object_free(folder, CAMEL_FOLDER_NAME, name);
+					camel_object_get (folder, NULL, CAMEL_FOLDER_NAME, &name, NULL);
+					e_error_run ((GtkWindow *)composer, "mail-composer:attach-nomessages",
+						    name?name:(char *)selection->data, camel_exception_get_description (&ex), NULL);
+					camel_object_free (folder, CAMEL_FOLDER_NAME, name);
 				}
-				camel_object_unref(folder);
+				camel_object_unref (folder);
 			} else {
-				e_error_run((GtkWindow *)composer, "mail-composer:attach-nomessages",
-					    (const gchar*)selection->data, camel_exception_get_description(&ex), NULL);
+				e_error_run ((GtkWindow *)composer, "mail-composer:attach-nomessages",
+					    (const gchar*)selection->data, camel_exception_get_description (&ex), NULL);
 			}
 
-			camel_exception_clear(&ex);
+			camel_exception_clear (&ex);
 		}
 
-		g_ptr_array_free(uids, TRUE);
+		g_ptr_array_free (uids, TRUE);
 
 		break; }
 	default:
-		d(printf ("dropping an unknown\n"));
+		d (printf ("dropping an unknown\n"));
 		break;
 	}
 
-	if (e_attachment_bar_get_num_attachments(E_ATTACHMENT_BAR(p->attachment_bar)))
+	if (e_attachment_bar_get_num_attachments (E_ATTACHMENT_BAR (p->attachment_bar)))
 		show_attachments (composer, TRUE);
 
-	gtk_drag_finish(context, success, delete, time);
+	gtk_drag_finish (context, success, delete, time);
 }
 
 static void
-drop_popup_copy(EPopup *ep, EPopupItem *item, void *data)
+drop_popup_copy (EPopup *ep, EPopupItem *item, gpointer data)
 {
 	struct _drop_data *m = data;
-	drop_action(m->composer, m->context, GDK_ACTION_COPY, m->selection, m->info, m->time, FALSE);
+	drop_action (m->composer, m->context, GDK_ACTION_COPY, m->selection, m->info, m->time, FALSE);
 }
 
 static void
-drop_popup_move(EPopup *ep, EPopupItem *item, void *data)
+drop_popup_move (EPopup *ep, EPopupItem *item, gpointer data)
 {
 	struct _drop_data *m = data;
-	drop_action(m->composer, m->context, GDK_ACTION_MOVE, m->selection, m->info, m->time, FALSE);
+	drop_action (m->composer, m->context, GDK_ACTION_MOVE, m->selection, m->info, m->time, FALSE);
 }
 
 static void
-drop_popup_cancel(EPopup *ep, EPopupItem *item, void *data)
+drop_popup_cancel (EPopup *ep, EPopupItem *item, gpointer data)
 {
 	struct _drop_data *m = data;
-	gtk_drag_finish(m->context, FALSE, FALSE, m->time);
+	gtk_drag_finish (m->context, FALSE, FALSE, m->time);
 }
 
 static EPopupItem drop_popup_menu[] = {
-	{ E_POPUP_ITEM, "00.emc.02", N_("_Copy"), drop_popup_copy, NULL, "mail-copy", 0 },
-	{ E_POPUP_ITEM, "00.emc.03", N_("_Move"), drop_popup_move, NULL, "mail-move", 0 },
+	{ E_POPUP_ITEM, "00.emc.02", N_ ("_Copy"), drop_popup_copy, NULL, "mail-copy", 0 },
+	{ E_POPUP_ITEM, "00.emc.03", N_ ("_Move"), drop_popup_move, NULL, "mail-move", 0 },
 	{ E_POPUP_BAR, "10.emc" },
-	{ E_POPUP_ITEM, "99.emc.00", N_("Cancel _Drag"), drop_popup_cancel, NULL, NULL, 0 },
+	{ E_POPUP_ITEM, "99.emc.00", N_ ("Cancel _Drag"), drop_popup_cancel, NULL, NULL, 0 },
 };
 
 static void
-drop_popup_free(EPopup *ep, GSList *items, void *data)
+drop_popup_free (EPopup *ep, GSList *items, gpointer data)
 {
 	struct _drop_data *m = data;
 
-	g_slist_free(items);
+	g_slist_free (items);
 
-	g_object_unref(m->context);
-	g_object_unref(m->composer);
-	g_free(m->selection->data);
-	g_free(m->selection);
-	g_free(m);
+	g_object_unref (m->context);
+	g_object_unref (m->composer);
+	g_free (m->selection->data);
+	g_free (m->selection);
+	g_free (m);
 }
 
 static void
 drag_data_received (GtkWidget *w, GdkDragContext *context,
-		    int x, int y, GtkSelectionData *selection,
+		    gint x, gint y, GtkSelectionData *selection,
 		    guint info, guint time,
 		    EMsgComposer *composer)
 {
@@ -3329,47 +3307,47 @@
 		EMPopup *emp;
 		GSList *menus = NULL;
 		GtkMenu *menu;
-		int i;
+		gint i;
 		struct _drop_data *m;
 
-		m = g_malloc0(sizeof(*m));
+		m = g_malloc0 (sizeof (*m));
 		m->context = context;
-		g_object_ref(context);
+		g_object_ref (context);
 		m->composer = composer;
-		g_object_ref(composer);
+		g_object_ref (composer);
 		m->action = context->action;
 		m->info = info;
 		m->time = time;
-		m->selection = g_malloc0(sizeof(*m->selection));
-		m->selection->data = g_malloc(selection->length);
-		memcpy(m->selection->data, selection->data, selection->length);
+		m->selection = g_malloc0 (sizeof (*m->selection));
+		m->selection->data = g_malloc (selection->length);
+		memcpy (m->selection->data, selection->data, selection->length);
 		m->selection->length = selection->length;
 
-		emp = em_popup_new("org.gnome.evolution.mail.composer.popup.drop");
-		for (i=0;i<sizeof(drop_popup_menu)/sizeof(drop_popup_menu[0]);i++)
-			menus = g_slist_append(menus, &drop_popup_menu[i]);
-
-		e_popup_add_items((EPopup *)emp, menus, NULL, drop_popup_free, m);
-		menu = e_popup_create_menu_once((EPopup *)emp, NULL, 0);
-		gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, time);
+		emp = em_popup_new ("org.gnome.evolution.mail.composer.popup.drop");
+		for (i = 0; i < G_N_ELEMENTS (drop_popup_menu); i++)
+			menus = g_slist_append (menus, &drop_popup_menu[i]);
+
+		e_popup_add_items ((EPopup *)emp, menus, NULL, drop_popup_free, m);
+		menu = e_popup_create_menu_once ((EPopup *)emp, NULL, 0);
+		gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 0, time);
 	} else {
-		drop_action(composer, context, context->action, selection, info, time, w != GTK_WIDGET (composer));
+		drop_action (composer, context, context->action, selection, info, time, w != GTK_WIDGET (composer));
 	}
 }
 
 
 static gboolean
-drag_motion(GObject *o, GdkDragContext *context, gint x, gint y, guint time, EMsgComposer *composer)
+drag_motion (GObject *o, GdkDragContext *context, gint x, gint y, guint time, EMsgComposer *composer)
 {
 	GList *targets;
 	GdkDragAction action, actions = 0;
 
 	for (targets = context->targets; targets; targets = targets->next) {
-		int i;
+		gint ii;
 
-		for (i=0;i<sizeof(drag_info)/sizeof(drag_info[0]);i++)
-			if (targets->data == (void *)drag_info[i].atom)
-				actions |= drag_info[i].actions;
+		for (ii = 0; ii < G_N_ELEMENTS (drag_info); ii++)
+			if (targets->data == (gpointer) drag_info[ii].atom)
+				actions |= drag_info[ii].actions;
 	}
 
 	actions &= context->actions;
@@ -3378,32 +3356,35 @@
 	if (action == GDK_ACTION_ASK && (actions & (GDK_ACTION_MOVE|GDK_ACTION_COPY)) != (GDK_ACTION_MOVE|GDK_ACTION_COPY))
 		action = GDK_ACTION_COPY;
 
-	gdk_drag_status(context, action, time);
+	gdk_drag_status (context, action, time);
 
 	return action != 0;
 }
 
 static void
-class_init (EMsgComposerClass *klass)
+msg_composer_class_init (EMsgComposerClass *class)
 {
-	GtkObjectClass *object_class;
+	GObjectClass *object_class;
+	GtkObjectClass *gtk_object_class;
 	GtkWidgetClass *widget_class;
-	GObjectClass *gobject_class;
-	int i;
+	gint ii;
+
+	for (ii = 0; ii < G_N_ELEMENTS (drag_info); ii++)
+		drag_info[ii].atom =
+			gdk_atom_intern (drag_info[ii].target, FALSE);
 
-	for (i=0;i<sizeof(drag_info)/sizeof(drag_info[0]);i++)
-		drag_info[i].atom = gdk_atom_intern(drag_info[i].target, FALSE);
+	parent_class = g_type_class_peek_parent (class);
+	g_type_class_add_private (class, sizeof (EMsgComposerPrivate));
 
-	gobject_class = G_OBJECT_CLASS(klass);
-	object_class = GTK_OBJECT_CLASS (klass);
-	widget_class = GTK_WIDGET_CLASS (klass);
-
-	gobject_class->finalize = composer_finalise;
-	gobject_class->dispose = composer_dispose;
-	object_class->destroy = destroy;
-	widget_class->delete_event = delete_event;
+	object_class = G_OBJECT_CLASS (class);
+	object_class->dispose = msg_composer_dispose;
+	object_class->finalize = msg_composer_finalize;
 
-	parent_class = g_type_class_ref(bonobo_window_get_type ());
+	gtk_object_class = GTK_OBJECT_CLASS (class);
+	gtk_object_class->destroy = msg_composer_destroy;
+
+	widget_class = GTK_WIDGET_CLASS (class);
+	widget_class->delete_event = msg_composer_delete_event;
 
 	signals[SEND] =
 		g_signal_new ("send",
@@ -3426,12 +3407,13 @@
 }
 
 static void
-init (EMsgComposer *composer)
+msg_composer_init (EMsgComposer *composer)
 {
-	EMsgComposerPrivate *p = g_new0(EMsgComposerPrivate,1);
 	GHashTable *inline_images;
 	GHashTable *inline_images_by_url;
 
+	composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
+
 	inline_images = g_hash_table_new_full (
 		g_str_hash, g_str_equal,
 		(GDestroyNotify) g_free,
@@ -3442,45 +3424,18 @@
 		(GDestroyNotify) g_free,
 		(GDestroyNotify) camel_object_unref);
 
-	p->uic                      = NULL;
-
-	p->extra_hdr_names          = g_ptr_array_new ();
-	p->extra_hdr_values         = g_ptr_array_new ();
-
-	p->focused_entry            = NULL;
+	composer->priv->extra_hdr_names = g_ptr_array_new ();
+	composer->priv->extra_hdr_values = g_ptr_array_new ();
 
-	p->eeditor                   = NULL;
+	composer->priv->persist_file_interface = CORBA_OBJECT_NIL;
+	composer->priv->persist_stream_interface = CORBA_OBJECT_NIL;
 
-	p->address_dialog           = NULL;
+	composer->priv->eeditor_engine = CORBA_OBJECT_NIL;
+	composer->priv->inline_images = inline_images;
+	composer->priv->inline_images_by_url = inline_images_by_url;
 
-	p->attachment_bar           = NULL;
-	p->attachment_scrolled_window = NULL;
-
-	p->persist_file_interface   = CORBA_OBJECT_NIL;
-	p->persist_stream_interface = CORBA_OBJECT_NIL;
-
-	p->eeditor_engine            = CORBA_OBJECT_NIL;
-	p->inline_images            = inline_images;
-	p->inline_images_by_url     = inline_images_by_url;
-	p->current_images           = NULL;
-
-	p->attachment_bar_visible   = FALSE;
-	p->send_html                = FALSE;
-	p->pgp_sign                 = FALSE;
-	p->pgp_encrypt              = FALSE;
-	p->smime_sign               = FALSE;
-	p->smime_encrypt            = FALSE;
-
-	p->has_changed              = FALSE;
-	p->autosaved                = FALSE;
-
-	p->redirect                 = NULL;
-	p->send_invoked		    = FALSE;
-	p->charset                  = NULL;
-
-	p->enable_autosave          = TRUE;
-	p->autosave_file            = NULL;
-	p->autosave_fd              = -1;
+	composer->priv->enable_autosave = TRUE;
+	composer->priv->autosave_fd = -1;
 
 	/** @HookPoint-EMMenu: Main Mail Menu
 	 * @Id: org.gnome.evolution.mail.composer
@@ -3490,36 +3445,38 @@
 	 * The main menu of the composer window.  The widget of the
 	 * target will point to the EMsgComposer object.
 	 */
-	p->menu = em_menu_new("org.gnome.evolution.mail.composer");
-
-	composer->priv = p;
+	composer->priv->menu =
+		em_menu_new ("org.gnome.evolution.mail.composer");
 }
 
-
-GtkType
+GType
 e_msg_composer_get_type (void)
 {
 	static GType type = 0;
 
-	if (type == 0) {
-		static const GTypeInfo info = {
+	if (G_UNLIKELY (type == 0)) {
+		static const GTypeInfo type_info = {
 			sizeof (EMsgComposerClass),
-			NULL, NULL,
-			(GClassInitFunc) class_init,
-			NULL, NULL,
+			(GBaseInitFunc) NULL,
+			(GBaseFinalizeFunc) NULL,
+			(GClassInitFunc) msg_composer_class_init,
+			(GClassFinalizeFunc) NULL,
+			NULL,  /* class_data */
 			sizeof (EMsgComposer),
-			0,
-			(GInstanceInitFunc) init,
+			0,     /* n_preallocs */
+			(GInstanceInitFunc) msg_composer_init,
+			NULL   /* value_table */
 		};
 
-		type = g_type_register_static (bonobo_window_get_type (), "EMsgComposer", &info, 0);
+		type = g_type_register_static (
+			BONOBO_TYPE_WINDOW, "EMsgComposer", &type_info, 0);
 	}
 
 	return type;
 }
 
 static void
-e_msg_composer_load_config (EMsgComposer *composer, int visible_mask)
+e_msg_composer_load_config (EMsgComposer *composer, gint visible_mask)
 {
 	GConfClient *gconf;
 	EMsgComposerPrivate *p = composer->priv;
@@ -3569,7 +3526,7 @@
 	EComposerHeaderTable *table;
 	GtkWidget *widget;
 	CORBA_Environment ev;
-	const char *text;
+	const gchar *text;
 	EMsgComposerPrivate *p = composer->priv;
 
 	table = e_msg_composer_get_header_table (composer);
@@ -3604,15 +3561,15 @@
 }
 
 static void
-msg_composer_destroy_notify (void *data)
+msg_composer_destroy_notify (gpointer data)
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (data);
 
 	all_composers = g_slist_remove (all_composers, composer);
 }
 
-static int
-composer_key_pressed (EMsgComposer *composer, GdkEventKey *event, void *user_data)
+static gint
+composer_key_pressed (EMsgComposer *composer, GdkEventKey *event, gpointer user_data)
 {
 	GtkWidget *widget;
 	EComposerHeaderTable *table;
@@ -3634,7 +3591,7 @@
 		do_exit (composer);
 		g_signal_stop_emission_by_name (composer, "key-press-event");
 		return TRUE;
-	} else if ((event->keyval == GDK_Tab) && (gtk_widget_is_focus(widget))) {
+	} else if ((event->keyval == GDK_Tab) && (gtk_widget_is_focus (widget))) {
 		CORBA_Environment ev;
 		CORBA_exception_init (&ev);
 		GNOME_GtkHTML_Editor_Engine_runCommand (p->eeditor_engine, "grab-focus", &ev);
@@ -3662,7 +3619,7 @@
 	EMsgComposer *composer = user_data;
 	EMsgComposerPrivate *p = composer->priv;
 	BonoboUIContainer *container;
-	char *xmlfile;
+	gchar *xmlfile;
 
 	p->focused_entry = widget;
 
@@ -3773,7 +3730,7 @@
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (widget);
 	GConfClient *gconf;
-	int width, height;
+	gint width, height;
 
 	gtk_window_get_size (GTK_WINDOW (composer), &width, &height);
 
@@ -3786,41 +3743,41 @@
 /* Callbacks.  */
 
 static void
-emcab_add(EPopup *ep, EPopupItem *item, void *data)
+emcab_add (EPopup *ep, EPopupItem *item, gpointer data)
 {
 	EAttachmentBar *bar = data;
 	EMsgComposer *toplevel = E_MSG_COMPOSER (gtk_widget_get_toplevel (GTK_WIDGET (bar)));
-	GtkWidget **attachment_selector = e_attachment_bar_get_selector(E_ATTACHMENT_BAR(bar));
+	GtkWidget **attachment_selector = e_attachment_bar_get_selector (E_ATTACHMENT_BAR (bar));
 
 	e_msg_composer_select_file_attachments (toplevel, attachment_selector, add_to_bar);
 }
 
 static void
-emcab_properties(EPopup *ep, EPopupItem *item, void *data)
+emcab_properties (EPopup *ep, EPopupItem *item, gpointer data)
 {
 	EAttachmentBar *bar = data;
 
-	e_attachment_bar_edit_selected(bar);
+	e_attachment_bar_edit_selected (bar);
 }
 
 static void
-emcab_remove(EPopup *ep, EPopupItem *item, void *data)
+emcab_remove (EPopup *ep, EPopupItem *item, gpointer data)
 {
 	EAttachmentBar *bar = data;
 
-	e_attachment_bar_remove_selected(bar);
+	e_attachment_bar_remove_selected (bar);
 }
 
 /* Popup menu handling.  */
 static EPopupItem emcab_popups[] = {
-	{ E_POPUP_ITEM, "10.attach", N_("_Remove"), emcab_remove, NULL, GTK_STOCK_REMOVE, EM_POPUP_ATTACHMENTS_MANY },
-	{ E_POPUP_ITEM, "20.attach", N_("_Properties"), emcab_properties, NULL, GTK_STOCK_PROPERTIES, EM_POPUP_ATTACHMENTS_ONE },
+	{ E_POPUP_ITEM, "10.attach", N_ ("_Remove"), emcab_remove, NULL, GTK_STOCK_REMOVE, EM_POPUP_ATTACHMENTS_MANY },
+	{ E_POPUP_ITEM, "20.attach", N_ ("_Properties"), emcab_properties, NULL, GTK_STOCK_PROPERTIES, EM_POPUP_ATTACHMENTS_ONE },
 	{ E_POPUP_BAR, "30.attach.00", NULL, NULL, NULL, NULL, EM_POPUP_ATTACHMENTS_MANY|EM_POPUP_ATTACHMENTS_ONE },
-	{ E_POPUP_ITEM, "30.attach.01", N_("_Add attachment..."), emcab_add, NULL, GTK_STOCK_ADD, 0 },
+	{ E_POPUP_ITEM, "30.attach.01", N_ ("_Add attachment..."), emcab_add, NULL, GTK_STOCK_ADD, 0 },
 };
 
 static void
-emcab_popup_position(GtkMenu *menu, int *x, int *y, gboolean *push_in, gpointer user_data)
+emcab_popup_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
 {
 	EAttachmentBar *bar = user_data;
 	GnomeIconList *icon_list = user_data;
@@ -3833,7 +3790,7 @@
 	if (selection == NULL)
 		return;
 
-	image = gnome_icon_list_get_icon_pixbuf_item (icon_list, GPOINTER_TO_INT(selection->data));
+	image = gnome_icon_list_get_icon_pixbuf_item (icon_list, GPOINTER_TO_INT (selection->data));
 	if (image == NULL)
 		return;
 
@@ -3843,26 +3800,26 @@
 }
 
 static void
-emcab_popups_free(EPopup *ep, GSList *l, void *data)
+emcab_popups_free (EPopup *ep, GSList *l, gpointer data)
 {
-	g_slist_free(l);
+	g_slist_free (l);
 }
 
 /* if id != -1, then use it as an index for target of the popup */
 
 static void
-emcab_popup(EAttachmentBar *bar, GdkEventButton *event, int id)
+emcab_popup (EAttachmentBar *bar, GdkEventButton *event, gint id)
 {
 	GSList *attachments = NULL, *menus = NULL;
-	int i;
+	gint i;
 	EMPopup *emp;
 	EMPopupTargetAttachments *t;
 	GtkMenu *menu;
 
-	attachments = e_attachment_bar_get_attachment(bar, id);
+	attachments = e_attachment_bar_get_attachment (bar, id);
 
-	for (i=0;i<sizeof(emcab_popups)/sizeof(emcab_popups[0]);i++)
-		menus = g_slist_prepend(menus, &emcab_popups[i]);
+	for (i = 0; i < G_N_ELEMENTS (emcab_popups); i++)
+		menus = g_slist_prepend (menus, &emcab_popups[i]);
 
 	/** @HookPoint-EMPopup: Composer Attachment Bar Context Menu
 	 * @Id: org.gnome.evolution.mail.composer.attachmentbar.popup
@@ -3871,51 +3828,51 @@
 	 *
 	 * This is the context menu on the composer attachment bar.
 	 */
-	emp = em_popup_new("org.gnome.evolution.mail.composer.attachmentbar.popup");
-	e_popup_add_items((EPopup *)emp, menus, NULL,emcab_popups_free, bar);
-	t = em_popup_target_new_attachments(emp, attachments);
+	emp = em_popup_new ("org.gnome.evolution.mail.composer.attachmentbar.popup");
+	e_popup_add_items ((EPopup *)emp, menus, NULL,emcab_popups_free, bar);
+	t = em_popup_target_new_attachments (emp, attachments);
 	t->target.widget = (GtkWidget *)bar;
-	menu = e_popup_create_menu_once((EPopup *)emp, (EPopupTarget *)t, 0);
+	menu = e_popup_create_menu_once ((EPopup *)emp, (EPopupTarget *)t, 0);
 
 	if (event == NULL)
-		gtk_menu_popup(menu, NULL, NULL, emcab_popup_position, bar, 0, gtk_get_current_event_time());
+		gtk_menu_popup (menu, NULL, NULL, emcab_popup_position, bar, 0, gtk_get_current_event_time ());
 	else
-		gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, event->time);
+		gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time);
 }
 
 static gboolean
 popup_menu_event (GtkWidget *widget)
 {
-	emcab_popup((EAttachmentBar *)widget, NULL, -1);
+	emcab_popup ((EAttachmentBar *)widget, NULL, -1);
 	return TRUE;
 }
 
 
-static int
+static gint
 button_press_event (GtkWidget *widget, GdkEventButton *event)
 {
 	EAttachmentBar *bar = (EAttachmentBar *)widget;
-	GnomeIconList *icon_list = GNOME_ICON_LIST(widget);
-	int icon_number;
+	GnomeIconList *icon_list = GNOME_ICON_LIST (widget);
+	gint icon_number;
 
 	if (event->button != 3)
 		return FALSE;
 
 	icon_number = gnome_icon_list_get_icon_at (icon_list, event->x, event->y);
 	if (icon_number >= 0) {
-		gnome_icon_list_unselect_all(icon_list);
+		gnome_icon_list_unselect_all (icon_list);
 		gnome_icon_list_select_icon (icon_list, icon_number);
 	}
 
-	emcab_popup(bar, event, icon_number);
+	emcab_popup (bar, event, icon_number);
 
 	return TRUE;
 }
 
 static gint
-key_press_event(GtkWidget *widget, GdkEventKey *event)
+key_press_event (GtkWidget *widget, GdkEventKey *event)
 {
-	EAttachmentBar *bar = E_ATTACHMENT_BAR(widget);
+	EAttachmentBar *bar = E_ATTACHMENT_BAR (widget);
 
 	if (event->keyval == GDK_Delete) {
 		e_attachment_bar_remove_selected (bar);
@@ -3975,10 +3932,10 @@
 	BonoboObject *impl;
 	EMsgComposerPrivate *p;
 
-	composer = g_object_new (E_TYPE_MSG_COMPOSER, "win_name", _("Compose Message"), NULL);
+	composer = g_object_new (E_TYPE_MSG_COMPOSER, "win_name", _ ("Compose Message"), NULL);
 	p = composer->priv;
 
-	gtk_window_set_title ((GtkWindow *) composer, _("Compose Message"));
+	gtk_window_set_title ((GtkWindow *) composer, _ ("Compose Message"));
 
 	all_composers = g_slist_prepend (all_composers, composer);
 
@@ -3998,9 +3955,9 @@
 	}
 
 	/* DND support */
-	gtk_drag_dest_set (GTK_WIDGET (composer), GTK_DEST_DEFAULT_ALL,  drop_types, num_drop_types, GDK_ACTION_COPY|GDK_ACTION_ASK|GDK_ACTION_MOVE);
-	g_signal_connect(composer, "drag_data_received", G_CALLBACK (drag_data_received), composer);
-	g_signal_connect(composer, "drag-motion", G_CALLBACK(drag_motion), composer);
+	gtk_drag_dest_set (GTK_WIDGET (composer), GTK_DEST_DEFAULT_ALL,  drop_types, G_N_ELEMENTS (drop_types), GDK_ACTION_COPY|GDK_ACTION_ASK|GDK_ACTION_MOVE);
+	g_signal_connect (composer, "drag_data_received", G_CALLBACK (drag_data_received), composer);
+	g_signal_connect (composer, "drag-motion", G_CALLBACK (drag_motion), composer);
 	e_msg_composer_load_config (composer, visible_mask);
 
 	setup_ui (composer);
@@ -4103,7 +4060,7 @@
 
 	gtk_box_pack_start (GTK_BOX (vbox), p->eeditor, TRUE, TRUE, 0);
 
-	/* Attachment editor, wrapped into an EScrollFrame.  It's
+	/* Attachment editor, wrapped ginto an EScrollFrame.  It's
 	   hidden in an EExpander. */
 
 	p->attachment_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
@@ -4126,7 +4083,7 @@
 			  G_CALLBACK (attachment_bar_changed_cb), composer);
 
 	p->attachment_expander_label =
-		gtk_label_new_with_mnemonic (_("Show _Attachment Bar"));
+		gtk_label_new_with_mnemonic (_ ("Show _Attachment Bar"));
 	p->attachment_expander_num = gtk_label_new ("");
 	gtk_label_set_use_markup (GTK_LABEL (p->attachment_expander_num), TRUE);
 	gtk_misc_set_alignment (GTK_MISC (p->attachment_expander_label), 0.0, 0.5);
@@ -4177,7 +4134,7 @@
 
 	servant = ORBit_small_get_servant (p->eeditor_engine);
     	if (servant && (impl = bonobo_object (servant)))
-		html_widget = g_object_get_data (G_OBJECT(impl), "html-widget");
+		html_widget = g_object_get_data (G_OBJECT (impl), "html-widget");
 
 	if (html_widget) {
 		g_signal_connect (html_widget, "drag_data_received", G_CALLBACK (drag_data_received), composer);
@@ -4268,7 +4225,7 @@
 }
 
 static gboolean
-is_special_header (const char *hdr_name)
+is_special_header (const gchar *hdr_name)
 {
 	/* Note: a header is a "special header" if it has any meaning:
 	   1. it's not a X-* header or
@@ -4286,9 +4243,9 @@
 }
 
 static void
-e_msg_composer_set_pending_body (EMsgComposer *composer, char *text, ssize_t len)
+e_msg_composer_set_pending_body (EMsgComposer *composer, gchar *text, ssize_t len)
 {
-	char *old;
+	gchar *old;
 
 	old = g_object_get_data ((GObject *) composer, "body:text");
 	g_free (old);
@@ -4299,7 +4256,7 @@
 static void
 e_msg_composer_flush_pending_body (EMsgComposer *composer, gboolean apply)
 {
-	char *body;
+	gchar *body;
 	ssize_t len;
 
 	body = g_object_get_data ((GObject *) composer, "body:text");
@@ -4315,7 +4272,7 @@
 
 static void
 add_attachments_handle_mime_part (EMsgComposer *composer, CamelMimePart *mime_part,
-				  gboolean just_inlines, gboolean related, int depth)
+				  gboolean just_inlines, gboolean related, gint depth)
 {
 	CamelContentType *content_type;
 	CamelDataWrapper *wrapper;
@@ -4348,12 +4305,12 @@
 
 static void
 add_attachments_from_multipart (EMsgComposer *composer, CamelMultipart *multipart,
-				gboolean just_inlines, int depth)
+				gboolean just_inlines, gint depth)
 {
 	/* find appropriate message attachments to add to the composer */
 	CamelMimePart *mime_part;
 	gboolean related;
-	int i, nparts;
+	gint i, nparts;
 
 	related = camel_content_type_is (CAMEL_DATA_WRAPPER (multipart)->mime_type, "multipart", "related");
 
@@ -4399,7 +4356,7 @@
 
 
 static void
-handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int depth)
+handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, gint depth)
 {
 	CamelContentType *content_type;
 	CamelDataWrapper *content;
@@ -4440,7 +4397,7 @@
 		}
 	} else if (camel_content_type_is (content_type, "text", "*")) {
 		ssize_t len;
-		char *html;
+		gchar *html;
 
 		html = em_utils_part_to_html (mime_part, &len, NULL);
 		e_msg_composer_set_pending_body (composer, html, len);
@@ -4450,7 +4407,7 @@
 }
 
 static void
-handle_multipart_encrypted (EMsgComposer *composer, CamelMimePart *multipart, int depth)
+handle_multipart_encrypted (EMsgComposer *composer, CamelMimePart *multipart, gint depth)
 {
 	CamelContentType *content_type;
 	CamelCipherContext *cipher;
@@ -4464,13 +4421,13 @@
 
 	camel_exception_init (&ex);
 	cipher = mail_crypto_get_pgp_cipher_context (NULL);
-	mime_part = camel_mime_part_new();
-	valid = camel_cipher_decrypt(cipher, multipart, mime_part, &ex);
-	camel_object_unref(cipher);
+	mime_part = camel_mime_part_new ();
+	valid = camel_cipher_decrypt (cipher, multipart, mime_part, &ex);
+	camel_object_unref (cipher);
 	camel_exception_clear (&ex);
 	if (valid == NULL)
 		return;
-	camel_cipher_validity_free(valid);
+	camel_cipher_validity_free (valid);
 
 	content_type = camel_mime_part_get_content_type (mime_part);
 
@@ -4499,7 +4456,7 @@
 		}
 	} else if (camel_content_type_is (content_type, "text", "*")) {
 		ssize_t len;
-		char *html;
+		gchar *html;
 
 		html = em_utils_part_to_html (mime_part, &len, NULL);
 		e_msg_composer_set_pending_body (composer, html, len);
@@ -4511,11 +4468,11 @@
 }
 
 static void
-handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, int depth)
+handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, gint depth)
 {
 	/* Find the text/html part and set the composer body to it's contents */
 	CamelMimePart *text_part = NULL;
-	int i, nparts;
+	gint i, nparts;
 
 	nparts = camel_multipart_get_number (multipart);
 
@@ -4563,17 +4520,17 @@
 
 	if (text_part) {
 		ssize_t len;
-		char *html;
+		gchar *html;
 
-		html = em_utils_part_to_html(text_part, &len, NULL);
-		e_msg_composer_set_pending_body(composer, html, len);
+		html = em_utils_part_to_html (text_part, &len, NULL);
+		e_msg_composer_set_pending_body (composer, html, len);
 	}
 }
 
 static void
-handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth)
+handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, gint depth)
 {
-	int i, nparts;
+	gint i, nparts;
 
 	nparts = camel_multipart_get_number (multipart);
 
@@ -4609,11 +4566,11 @@
 			}
 		} else if (depth == 0 && i == 0) {
 			ssize_t len;
-			char *html;
+			gchar *html;
 
 			/* Since the first part is not multipart/alternative, then this must be the body */
-			html = em_utils_part_to_html(mime_part, &len, NULL);
-			e_msg_composer_set_pending_body(composer, html, len);
+			html = em_utils_part_to_html (mime_part, &len, NULL);
+			e_msg_composer_set_pending_body (composer, html, len);
 		} else if (camel_mime_part_get_content_id (mime_part) ||
 			   camel_mime_part_get_content_location (mime_part)) {
 			/* special in-line attachment */
@@ -4637,7 +4594,7 @@
 
 	CORBA_exception_init (&ev);
 	if (GNOME_GtkHTML_Editor_Engine_searchByData (p->eeditor_engine, 1, "ClueFlow", "signature", "1", &ev)) {
-		char *name, *str = NULL;
+		gchar *name, *str = NULL;
 
 		str = GNOME_GtkHTML_Editor_Engine_getParagraphData (p->eeditor_engine, "signature_name", &ev);
 		if (ev._major == CORBA_NO_EXCEPTION && str) {
@@ -4674,31 +4631,31 @@
 {
 	const CamelInternetAddress *to, *cc, *bcc;
 	GList *To = NULL, *Cc = NULL, *Bcc = NULL, *postto = NULL;
-	const char *format, *subject;
+	const gchar *format, *subject;
 	EDestination **Tov, **Ccv, **Bccv;
 	GHashTable *auto_cc, *auto_bcc;
 	CamelContentType *content_type;
 	struct _camel_header_raw *headers;
 	CamelDataWrapper *content;
 	EAccount *account = NULL;
-	char *account_name;
+	gchar *account_name;
 	EMsgComposer *new;
 	EComposerHeaderTable *table;
 	struct _camel_header_raw *xev;
-	int len, i;
+	gint len, i;
 	EMsgComposerPrivate *p;
 
 	for (headers = CAMEL_MIME_PART (message)->headers;headers;headers = headers->next) {
-		if (!strcmp(headers->name, "X-Evolution-PostTo"))
-			postto = g_list_append(postto, g_strstrip(g_strdup(headers->value)));
+		if (!strcmp (headers->name, "X-Evolution-PostTo"))
+			postto = g_list_append (postto, g_strstrip (g_strdup (headers->value)));
 	}
 
 	new = create_composer (postto ? E_MSG_COMPOSER_VISIBLE_MASK_POST : E_MSG_COMPOSER_VISIBLE_MASK_MAIL);
 	p = new->priv;
 
 	if (!new) {
-		g_list_foreach(postto, (GFunc)g_free, NULL);
-		g_list_free(postto);
+		g_list_foreach (postto, (GFunc)g_free, NULL);
+		g_list_free (postto);
 		return NULL;
 	}
 
@@ -4706,8 +4663,8 @@
 
 	if (postto) {
 		e_composer_header_table_set_post_to_list (table, postto);
-		g_list_foreach(postto, (GFunc)g_free, NULL);
-		g_list_free(postto);
+		g_list_foreach (postto, (GFunc)g_free, NULL);
+		g_list_free (postto);
 		postto = NULL;
 	}
 
@@ -4717,9 +4674,9 @@
 		account_name = g_strdup (account_name);
 		g_strstrip (account_name);
 
-		if ((account = mail_config_get_account_by_uid(account_name)) == NULL)
+		if ((account = mail_config_get_account_by_uid (account_name)) == NULL)
 			/* 'old' setting */
-			account = mail_config_get_account_by_name(account_name);
+			account = mail_config_get_account_by_name (account_name);
 		if (account) {
 			g_free (account_name);
 			account_name = g_strdup (account->name);
@@ -4745,7 +4702,7 @@
 				iaddr = camel_internet_address_new ();
 				if (camel_address_decode (CAMEL_ADDRESS (iaddr), account->cc_addrs) != -1) {
 					for (i = 0; i < camel_address_length (CAMEL_ADDRESS (iaddr)); i++) {
-						const char *name, *addr;
+						const gchar *name, *addr;
 
 						if (!camel_internet_address_get (iaddr, i, &name, &addr))
 							continue;
@@ -4760,7 +4717,7 @@
 				iaddr = camel_internet_address_new ();
 				if (camel_address_decode (CAMEL_ADDRESS (iaddr), account->bcc_addrs) != -1) {
 					for (i = 0; i < camel_address_length (CAMEL_ADDRESS (iaddr)); i++) {
-						const char *name, *addr;
+						const gchar *name, *addr;
 
 						if (!camel_internet_address_get (iaddr, i, &name, &addr))
 							continue;
@@ -4778,7 +4735,7 @@
 
 		len = CAMEL_ADDRESS (to)->addresses->len;
 		for (i = 0; i < len; i++) {
-			const char *name, *addr;
+			const gchar *name, *addr;
 
 			if (camel_internet_address_get (to, i, &name, &addr)) {
 				EDestination *dest = e_destination_new ();
@@ -4792,7 +4749,7 @@
 
 		len = CAMEL_ADDRESS (cc)->addresses->len;
 		for (i = 0; i < len; i++) {
-			const char *name, *addr;
+			const gchar *name, *addr;
 
 			if (camel_internet_address_get (cc, i, &name, &addr)) {
 				EDestination *dest = e_destination_new ();
@@ -4812,7 +4769,7 @@
 
 		len = CAMEL_ADDRESS (bcc)->addresses->len;
 		for (i = 0; i < len; i++) {
-			const char *name, *addr;
+			const gchar *name, *addr;
 
 			if (camel_internet_address_get (bcc, i, &name, &addr)) {
 				EDestination *dest = e_destination_new ();
@@ -4852,42 +4809,42 @@
 	/* Restore the format editing preference */
 	format = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Format");
 	if (format) {
-		char **flags;
+		gchar **flags;
 
-		while (*format && camel_mime_is_lwsp(*format))
+		while (*format && camel_mime_is_lwsp (*format))
 			format++;
 
-		flags = g_strsplit(format, ", ", 0);
+		flags = g_strsplit (format, ", ", 0);
 		for (i=0;flags[i];i++) {
-			printf("restoring draft flag '%s'\n", flags[i]);
+			printf ("restoring draft flag '%s'\n", flags[i]);
 
-			if (g_ascii_strcasecmp(flags[i], "text/html") == 0)
+			if (g_ascii_strcasecmp (flags[i], "text/html") == 0)
 				e_msg_composer_set_send_html (new, TRUE);
-			else if (g_ascii_strcasecmp(flags[i], "text/plain") == 0)
+			else if (g_ascii_strcasecmp (flags[i], "text/plain") == 0)
 				e_msg_composer_set_send_html (new, FALSE);
-			else if (g_ascii_strcasecmp(flags[i], "pgp-sign") == 0)
-				e_msg_composer_set_pgp_sign(new, TRUE);
-			else if (g_ascii_strcasecmp(flags[i], "pgp-encrypt") == 0)
-				e_msg_composer_set_pgp_encrypt(new, TRUE);
-			else if (g_ascii_strcasecmp(flags[i], "smime-sign") == 0)
-				e_msg_composer_set_smime_sign(new, TRUE);
-			else if (g_ascii_strcasecmp(flags[i], "smime-encrypt") == 0)
-				e_msg_composer_set_smime_encrypt(new, TRUE);
+			else if (g_ascii_strcasecmp (flags[i], "pgp-sign") == 0)
+				e_msg_composer_set_pgp_sign (new, TRUE);
+			else if (g_ascii_strcasecmp (flags[i], "pgp-encrypt") == 0)
+				e_msg_composer_set_pgp_encrypt (new, TRUE);
+			else if (g_ascii_strcasecmp (flags[i], "smime-sign") == 0)
+				e_msg_composer_set_smime_sign (new, TRUE);
+			else if (g_ascii_strcasecmp (flags[i], "smime-encrypt") == 0)
+				e_msg_composer_set_smime_encrypt (new, TRUE);
 		}
-		g_strfreev(flags);
+		g_strfreev (flags);
 	}
 
 	/* Remove any other X-Evolution-* headers that may have been set */
 	xev = mail_tool_remove_xevolution_headers (message);
-	camel_header_raw_clear(&xev);
+	camel_header_raw_clear (&xev);
 	
 	/* Check for receipt request */
-	if (camel_medium_get_header(CAMEL_MEDIUM(message), "Disposition-Notification-To")) {
+	if (camel_medium_get_header (CAMEL_MEDIUM (message), "Disposition-Notification-To")) {
 		e_msg_composer_set_request_receipt (new, TRUE);
 	}
 	
 	/* Check for mail priority */
-	if (camel_medium_get_header(CAMEL_MEDIUM(message), "X-Priority")) {
+	if (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Priority")) {
 		e_msg_composer_set_priority (new, TRUE);
 	}
 
@@ -4927,10 +4884,10 @@
 		}
 	} else {
 		ssize_t length;
-		char *html;
+		gchar *html;
 
-		html = em_utils_part_to_html((CamelMimePart *)message, &length, NULL);
-		e_msg_composer_set_pending_body(new, html, length);
+		html = em_utils_part_to_html ((CamelMimePart *)message, &length, NULL);
+		e_msg_composer_set_pending_body (new, html, length);
 	}
 
 	/* We wait until now to set the body text because we need to ensure that
@@ -4969,11 +4926,11 @@
  * Return value: A pointer to the newly created widget
  **/
 EMsgComposer *
-e_msg_composer_new_redirect (CamelMimeMessage *message, const char *resent_from)
+e_msg_composer_new_redirect (CamelMimeMessage *message, const gchar *resent_from)
 {
 	EMsgComposer *composer;
 	EComposerHeaderTable *table;
-	const char *subject;
+	const gchar *subject;
 
 	g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL);
 
@@ -4995,11 +4952,11 @@
 
 
 static GList *
-add_recipients (GList *list, const char *recips)
+add_recipients (GList *list, const gchar *recips)
 {
 	CamelInternetAddress *cia;
-	const char *name, *addr;
-	int num, i;
+	const gchar *name, *addr;
+	gint num, i;
 
 	cia = camel_internet_address_new ();
 	num = camel_address_decode (CAMEL_ADDRESS (cia), recips);
@@ -5018,17 +4975,17 @@
 }
 
 static void
-handle_mailto (EMsgComposer *composer, const char *mailto)
+handle_mailto (EMsgComposer *composer, const gchar *mailto)
 {
 	EMsgComposerPrivate *priv = composer->priv;
 	EComposerHeaderTable *table;
 	GList *to = NULL, *cc = NULL, *bcc = NULL;
 	EDestination **tov, **ccv, **bccv;
-	char *subject = NULL, *body = NULL;
-	char *header, *content, *buf;
+	gchar *subject = NULL, *body = NULL;
+	gchar *header, *content, *buf;
 	size_t nread, nwritten;
-	const char *p;
-	int len, clen;
+	const gchar *p;
+	gint len, clen;
 	CamelURL *url;
 
 	table = e_msg_composer_get_header_table (composer);
@@ -5155,7 +5112,7 @@
 	g_free (subject);
 
 	if (body) {
-		char *htmlbody;
+		gchar *htmlbody;
 
 		htmlbody = camel_text_to_html (body, CAMEL_MIME_FILTER_TOHTML_PRE, 0);
 		set_editor_text (composer, htmlbody, -1, FALSE, FALSE);
@@ -5164,7 +5121,7 @@
 }
 
 static void
-handle_uri (EMsgComposer *composer, const char *uri, gboolean html_dnd)
+handle_uri (EMsgComposer *composer, const gchar *uri, gboolean html_dnd)
 {
 	EMsgComposerPrivate *p = composer->priv;
 
@@ -5203,7 +5160,7 @@
  * defined by the provided URL.
  **/
 EMsgComposer *
-e_msg_composer_new_from_url (const char *url)
+e_msg_composer_new_from_url (const gchar *url)
 {
 	EMsgComposer *composer;
 
@@ -5223,10 +5180,10 @@
  * @composer: a composer object
  * @text: the HTML text to initialize the editor with
  *
- * Loads the given HTML text into the editor.
+ * Loads the given HTML text ginto the editor.
  **/
 void
-e_msg_composer_set_body_text (EMsgComposer *composer, const char *text, ssize_t len)
+e_msg_composer_set_body_text (EMsgComposer *composer, const gchar *text, ssize_t len)
 {
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 	g_return_if_fail (text != NULL);
@@ -5240,12 +5197,12 @@
  * @body: the data to initialize the composer with
  * @mime_type: the MIME type of data
  *
- * Loads the given data into the composer as the message body.
+ * Loads the given data ginto the composer as the message body.
  * This function should only be used by the CORBA composer factory.
  **/
 void
-e_msg_composer_set_body (EMsgComposer *composer, const char *body,
-			 const char *mime_type)
+e_msg_composer_set_body (EMsgComposer *composer, const gchar *body,
+			 const gchar *mime_type)
 {
 	EMsgComposerPrivate *p = composer->priv;
 	EComposerHeaderTable *table;
@@ -5254,7 +5211,7 @@
 
 	table = e_msg_composer_get_header_table (composer);
 
-	set_editor_text (composer, _("<b>(The composer contains a non-text message body, which cannot be edited.)</b>"), -1, FALSE, FALSE);
+	set_editor_text (composer, _ ("<b>(The composer contains a non-text message body, which cannot be edited.)</b>"), -1, FALSE, FALSE);
 	e_msg_composer_set_send_html (composer, FALSE);
 	disable_editor (composer);
 
@@ -5284,8 +5241,8 @@
  * the message it outputs.
  **/
 void
-e_msg_composer_add_header (EMsgComposer *composer, const char *name,
-			   const char *value)
+e_msg_composer_add_header (EMsgComposer *composer, const gchar *name,
+			   const gchar *value)
 {
 	EMsgComposerPrivate *p = composer->priv;
 
@@ -5308,8 +5265,8 @@
  * If not found then it creates a new header with @name and @change_value .
  **/
 void
-e_msg_composer_modify_header (EMsgComposer *composer, const char *name,
-			      const char *change_value)
+e_msg_composer_modify_header (EMsgComposer *composer, const gchar *name,
+			      const gchar *change_value)
 {
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 	g_return_if_fail (name != NULL);
@@ -5327,10 +5284,10 @@
  * Searches for the header and if found it removes it .
  **/
 void
-e_msg_composer_remove_header (EMsgComposer *composer, const char *name)
+e_msg_composer_remove_header (EMsgComposer *composer, const gchar *name)
 {
 	EMsgComposerPrivate *p;
-	int i;
+	gint i;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 	g_return_if_fail (name != NULL);
@@ -5381,17 +5338,17 @@
  **/
 CamelMimePart *
 e_msg_composer_add_inline_image_from_file (EMsgComposer *composer,
-					   const char *file_name)
+					   const gchar *file_name)
 {
-	char *mime_type, *cid, *url, *name, *dec_file_name;
+	gchar *mime_type, *cid, *url, *name, *dec_file_name;
 	CamelStream *stream;
 	CamelDataWrapper *wrapper;
 	CamelMimePart *part;
 	struct stat statbuf;
 	EMsgComposerPrivate *p = composer->priv;
 
-	dec_file_name = g_strdup(file_name);
-	camel_url_decode(dec_file_name);
+	dec_file_name = g_strdup (file_name);
+	camel_url_decode (dec_file_name);
 
 	/* check for regular file */
 	if (g_stat (dec_file_name, &statbuf) < 0 || !S_ISREG (statbuf.st_mode))
@@ -5415,9 +5372,9 @@
 
 	cid = camel_header_msgid_generate ();
 	camel_mime_part_set_content_id (part, cid);
-	name = g_path_get_basename(dec_file_name);
+	name = g_path_get_basename (dec_file_name);
 	camel_mime_part_set_filename (part, name);
-	g_free(name);
+	g_free (name);
 	camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_BASE64);
 
 	url = g_strdup_printf ("file:%s", dec_file_name);
@@ -5427,7 +5384,7 @@
 	g_hash_table_insert (p->inline_images, url, part);
 	g_free (cid);
 
-	g_free(dec_file_name);
+	g_free (dec_file_name);
 
 	return part;
 }
@@ -5445,8 +5402,8 @@
 e_msg_composer_add_inline_image_from_mime_part (EMsgComposer  *composer,
 						CamelMimePart *part)
 {
-	char *url;
-	const char *location, *cid;
+	gchar *url;
+	const gchar *location, *cid;
 	EMsgComposerPrivate *p = composer->priv;
 
 	cid = camel_mime_part_get_content_id (part);
@@ -5482,7 +5439,7 @@
 {
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
 	if ( e_msg_composer_get_remote_download_count (composer) != 0) {
-		if (!em_utils_prompt_user((GtkWindow *)composer, NULL, "mail-composer:ask-send-message-pending-download", NULL)) {
+		if (!em_utils_prompt_user ((GtkWindow *)composer, NULL, "mail-composer:ask-send-message-pending-download", NULL)) {
 			return NULL;
 		}
 	}
@@ -5547,7 +5504,7 @@
 	gboolean old_flags[4];
 	gboolean old_send_html;
 	GString *flags;
-	int i;
+	gint i;
 	EMsgComposerPrivate *p = composer->priv;
 
 	table = e_msg_composer_get_header_table (composer);
@@ -5579,22 +5536,22 @@
 	if (account && account->name)
 		camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Account", account->uid);
 
-	/* build_message() set this to text/html since we set p->send_html to
-	   TRUE before calling e_msg_composer_get_message() */
+	/* build_message () set this to text/html since we set p->send_html to
+	   TRUE before calling e_msg_composer_get_message () */
 	if (!p->send_html)
-		flags = g_string_new("text/plain");
+		flags = g_string_new ("text/plain");
 	else
-		flags = g_string_new("text/html");
+		flags = g_string_new ("text/html");
 
 	/* This should probably only save the setting if it is
 	 * different from the from-account default? */
 	for (i=0;i<4;i++) {
 		if (old_flags[i])
-			g_string_append_printf(flags, ", %s", emc_draft_format_names[i]);
+			g_string_append_printf (flags, ", %s", emc_draft_format_names[i]);
 	}
 
 	camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Format", flags->str);
-	g_string_free(flags, TRUE);
+	g_string_free (flags, TRUE);
 
 	return msg;
 }
@@ -5635,7 +5592,7 @@
 e_msg_composer_show_sig_file (EMsgComposer *composer)
 {
 	CORBA_Environment ev;
-	char *html;
+	gchar *html;
 	EMsgComposerPrivate *p = composer->priv;
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
@@ -6353,12 +6310,12 @@
  *
  * Returns the guessed mime type of the file given by #file_name.
  **/
-char *
-e_msg_composer_guess_mime_type (const char *file_name)
+gchar *
+e_msg_composer_guess_mime_type (const gchar *file_name)
 {
 	GnomeVFSFileInfo *info;
 	GnomeVFSResult result;
-	char *type = NULL;
+	gchar *type = NULL;
 
 	info = gnome_vfs_file_info_new ();
 	result = gnome_vfs_get_file_info (file_name, info,
@@ -6530,10 +6487,10 @@
 }
 
 void
-e_msg_composer_check_autosave(GtkWindow *parent)
+e_msg_composer_check_autosave (GtkWindow *parent)
 {
 	if (am == NULL)
-		am = autosave_manager_new();
+		am = autosave_manager_new ();
 
 	if (am->ask) {
 		am->ask = FALSE;
@@ -6547,7 +6504,7 @@
 {
 	EMsgComposerPrivate *p = composer->priv;
 
-	if (e_attachment_bar_get_num_attachments(E_ATTACHMENT_BAR(p->attachment_bar)))
+	if (e_attachment_bar_get_num_attachments (E_ATTACHMENT_BAR (p->attachment_bar)))
 		show_attachments (composer, TRUE);
 }
 
@@ -6713,7 +6670,7 @@
 {
 	EMsgComposerPrivate *p = composer->priv;
 	CamelMimePart *part;
-	const char *cid;
+	const gchar *cid;
 
 	part = g_hash_table_lookup (p->inline_images_by_url, url);
 	if (!part && !strncmp (url, "file:", 5)) {

Modified: branches/mbarnes-composer/composer/e-msg-composer.h
==============================================================================
--- branches/mbarnes-composer/composer/e-msg-composer.h	(original)
+++ branches/mbarnes-composer/composer/e-msg-composer.h	Mon Jan 28 01:17:46 2008
@@ -21,13 +21,9 @@
  * Author: Ettore Perazzoli
  */
 
-
 #ifndef ___E_MSG_COMPOSER_H__
 #define ___E_MSG_COMPOSER_H__
 
-typedef struct _EMsgComposer       EMsgComposer;
-typedef struct _EMsgComposerClass  EMsgComposerClass;
-
 #include <bonobo/bonobo-window.h>
 #include <bonobo/bonobo-ui-component.h>
 #include <camel/camel-internet-address.h>
@@ -38,59 +34,83 @@
 #include "e-composer-header-table.h"
 #include "Editor.h"
 
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-
-#define E_TYPE_MSG_COMPOSER	       (e_msg_composer_get_type ())
-#define E_MSG_COMPOSER(obj)	       (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MSG_COMPOSER, EMsgComposer))
-#define E_MSG_COMPOSER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MSG_COMPOSER, EMsgComposerClass))
-#define E_IS_MSG_COMPOSER(obj)	       (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MSG_COMPOSER))
-#define E_IS_MSG_COMPOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MSG_COMPOSER))
-
-
+/* Standard GObject macros */
+#define E_TYPE_MSG_COMPOSER \
+	(e_msg_composer_get_type ())
+#define E_MSG_COMPOSER(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_MSG_COMPOSER, EMsgComposer))
+#define E_MSG_COMPOSER_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_MSG_COMPOSER, EMsgComposerClass))
+#define E_IS_MSG_COMPOSER(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_MSG_COMPOSER))
+#define E_IS_MSG_COMPOSER_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((obj), E_TYPE_MSG_COMPOSER))
+#define E_MSG_COMPOSER_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_MSG_COMPOSER, EMsgComposerClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EMsgComposer EMsgComposer;
+typedef struct _EMsgComposerClass EMsgComposerClass;
+typedef struct _EMsgComposerPrivate EMsgComposerPrivate;
+
+struct _EMsgComposer {
+	BonoboWindow parent;
+	EMsgComposerPrivate *priv;
+};
+
+struct _EMsgComposerClass {
+	BonoboWindowClass parent_class;
+
+	void		(*send)			(EMsgComposer *composer);
+	void		(*save_draft)		(EMsgComposer *composer,
+						 gboolean quit);
+};
 
 struct _EAttachmentBar;
 
-GtkType                  e_msg_composer_get_type                         (void);
+GType		e_msg_composer_get_type		(void);
 
-EMsgComposer            *e_msg_composer_new                              (void);
+EMsgComposer *	e_msg_composer_new		(void);
 
 #define E_MSG_COMPOSER_MAIL 1
 #define E_MSG_COMPOSER_POST 2
 #define E_MSG_COMPOSER_MAIL_POST E_MSG_COMPOSER_MAIL|E_MSG_COMPOSER_POST
 
-EMsgComposer            *e_msg_composer_new_with_type                    (int type);
+EMsgComposer            *e_msg_composer_new_with_type                    (gint type);
 
 EMsgComposer            *e_msg_composer_new_with_message                 (CamelMimeMessage  *msg);
-EMsgComposer            *e_msg_composer_new_from_url                     (const char        *url);
+EMsgComposer            *e_msg_composer_new_from_url                     (const gchar        *url);
 EMsgComposer            *e_msg_composer_new_redirect                     (CamelMimeMessage  *message,
-									  const char        *resent_from);
+									  const gchar        *resent_from);
 void			e_msg_composer_show_attachments_ui		 (EMsgComposer *composer);
 
 void                     e_msg_composer_set_alternative                  (EMsgComposer      *composer,
 									  gboolean           alt);
 
 void                     e_msg_composer_set_body_text                    (EMsgComposer      *composer,
-									  const char        *text,
+									  const gchar        *text,
 									  ssize_t            len);
 void                     e_msg_composer_set_body                         (EMsgComposer      *composer,
-									  const char        *body,
-									  const char        *mime_type);
+									  const gchar        *body,
+									  const gchar        *mime_type);
 void                     e_msg_composer_add_header                       (EMsgComposer      *composer,
-									  const char        *name,
-									  const char        *value);
+									  const gchar        *name,
+									  const gchar        *value);
 void			 e_msg_composer_modify_header			 (EMsgComposer      *composer,
-									  const char 	    *name,
-									  const char        *value);
+									  const gchar 	    *name,
+									  const gchar        *value);
 void			 e_msg_composer_remove_header		          (EMsgComposer      *composer,
-									  const char        *name);
+									  const gchar        *name);
 void                     e_msg_composer_attach                           (EMsgComposer      *composer,
 									  CamelMimePart     *attachment);
 CamelMimePart           *e_msg_composer_add_inline_image_from_file       (EMsgComposer      *composer,
-									  const char        *filename);
+									  const gchar        *filename);
 void                     e_msg_composer_add_inline_image_from_mime_part  (EMsgComposer      *composer,
 									  CamelMimePart     *part);
 CamelMimeMessage        *e_msg_composer_get_message                      (EMsgComposer      *composer,
@@ -134,7 +154,7 @@
 CamelInternetAddress    *e_msg_composer_get_reply_to                     (EMsgComposer *composer);
 
 void                     e_msg_composer_clear_inlined_table              (EMsgComposer      *composer);
-char                    *e_msg_composer_guess_mime_type                  (const char        *file_name);
+gchar                    *e_msg_composer_guess_mime_type                  (const gchar        *file_name);
 void                     e_msg_composer_set_changed                      (EMsgComposer      *composer);
 void                     e_msg_composer_unset_changed                    (EMsgComposer      *composer);
 gboolean                 e_msg_composer_is_dirty                         (EMsgComposer      *composer);
@@ -159,18 +179,18 @@
 void                     e_msg_composer_set_smime_encrypt                (EMsgComposer      *composer,
 									  gboolean           smime_encrypt);
 gboolean                 e_msg_composer_get_smime_encrypt                (EMsgComposer      *composer);
-char                    *e_msg_composer_get_sig_file_content             (const char        *sigfile,
+gchar                    *e_msg_composer_get_sig_file_content             (const gchar        *sigfile,
 									  gboolean           in_html);
 void                     e_msg_composer_add_message_attachments          (EMsgComposer      *composer,
 									  CamelMimeMessage  *message,
 									  gboolean           just_inlines);
 void                     e_msg_composer_ignore                           (EMsgComposer      *composer,
-									  const char        *str);
+									  const gchar        *str);
 void                     e_msg_composer_drop_editor_undo                 (EMsgComposer      *composer);
 
 gboolean                 e_msg_composer_request_close_all                (void);
 void			 e_msg_composer_check_autosave			 (GtkWindow *parent);
-int			 e_msg_composer_get_remote_download_count   	 (EMsgComposer *composer);
+gint			 e_msg_composer_get_remote_download_count   	 (EMsgComposer *composer);
 
 
 void			 e_msg_composer_reply_indent			 (EMsgComposer *composer);
@@ -193,9 +213,6 @@
 void                     e_msg_composer_set_attach_path                  (EMsgComposer *composer, const gchar *path);
 const gchar *            e_msg_composer_get_attach_path                  (EMsgComposer *composer);
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* ___E_MSG_COMPOSER_H__ */



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