aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/.cvsignore9
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/Makefile.am8
-rw-r--r--mail/folder-browser-factory.c41
-rw-r--r--mail/html-stream.c17
-rw-r--r--mail/mail-display.c11
-rw-r--r--mail/mail-display.h1
-rw-r--r--mail/main.c5
-rw-r--r--mail/message-list.c7
9 files changed, 91 insertions, 15 deletions
diff --git a/mail/.cvsignore b/mail/.cvsignore
new file mode 100644
index 0000000000..cbfae6c992
--- /dev/null
+++ b/mail/.cvsignore
@@ -0,0 +1,9 @@
+.deps
+.libs
+Makefile
+Makefile.in
+Mail-stubs.c
+Mail-skels.c
+Mail-common.c
+Mail.h
+evolution-mail
diff --git a/mail/ChangeLog b/mail/ChangeLog
new file mode 100644
index 0000000000..3a20cd6415
--- /dev/null
+++ b/mail/ChangeLog
@@ -0,0 +1,7 @@
+2000-01-19 Miguel de Icaza <miguel@gnu.org>
+
+ * Started work on the mail display engine.
+
+ * html-stream.c, html-stream.h: New files, they are CamelStreams
+ used to write to the GtkHTML widget.
+
diff --git a/mail/Makefile.am b/mail/Makefile.am
index d53afb67b0..fa903d89d9 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -6,7 +6,7 @@ INCLUDES = \
-DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(datadir)/locale"\" \
-I$(srcdir)/../widgets \
- $(BONOBO_GNOME_CFLAGS)
+ $(BONOBO_HTML_GNOME_CFLAGS)
EVOLUTION_CORBA_GENERATED = \
Mail.h \
@@ -15,6 +15,8 @@ EVOLUTION_CORBA_GENERATED = \
Mail-stubs.c
evolution_mail_SOURCES = \
+ folder-browser-factory.c\
+ folder-browser-factory.h\
html-stream.c \
html-stream.h \
mail-display.h \
@@ -25,8 +27,10 @@ evolution_mail_SOURCES = \
$(EVOLUTION_CORBA_GENERATED)
evolution_mail_LDADD = \
+ ../widgets/e-table/libetable.a \
+ ../camel/libcamel.la \
../e-util/libeutil.a \
- $(BONOBO_GNOME_LIBS)
+ $(BONOBO_HTML_GNOME_LIBS)
$(EVOLUTION_MAIL_CORBA_GENERATED): Mail.idl
orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Mail.idl
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
new file mode 100644
index 0000000000..0b5f9e48d9
--- /dev/null
+++ b/mail/folder-browser-factory.c
@@ -0,0 +1,41 @@
+/*
+ * folder-browser-factory.c: A Bonobo Control factory for Folder Browsers
+ *
+ * Author:
+ * Miguel de Icaza (miguel@helixcode.com)
+ *
+ * (C) 2000 Helix Code, Inc.
+ */
+#include <config.h>
+#include <gnome.h>
+#include <bonobo/gnome-main.h>
+#include <bonobo/gnome-object.h>
+#include <bonobo/gnome-generic-factory.h>
+
+static GnomeObject *
+folder_browser_factory (GnomeGenericFactory *factory, void *closure)
+{
+ g_error ("Fill me in!");
+
+ return NULL;
+}
+
+void
+folder_browser_factory_init (void)
+{
+ static GnomeGenericFactory *bonobo_folder_browser_factory = NULL;
+
+ if (bonobo_folder_browser_factory != NULL)
+ return;
+
+ bonobo_folder_browser_factory =
+ gnome_generic_factory_new (
+ "Evolution:FolderBrowser:1.0",
+ folder_browser_factory, NULL);
+
+ if (bonobo_folder_browser_factory == NULL){
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("We are sorry, Evolution's Folder Browser can not be initialized."));
+ exit (1);
+ }
+}
diff --git a/mail/html-stream.c b/mail/html-stream.c
index 250e98500a..927f8f3593 100644
--- a/mail/html-stream.c
+++ b/mail/html-stream.c
@@ -12,6 +12,8 @@
#define PARENT_TYPE camel_stream_get_type ()
+static GtkObjectClass *html_stream_parent_class;
+
/*
* CamelStream::read method
*
@@ -34,6 +36,8 @@ html_stream_write (CamelStream *stream, const gchar *buffer, gint n)
HTMLStream *html_stream = HTML_STREAM (stream);
gtk_html_write (html_stream->gtk_html, html_stream->gtk_html_stream, buffer, n);
+
+ return n;
}
/*
@@ -52,7 +56,7 @@ html_stream_available (CamelStream *stream)
*
* We just return TRUE, as this is not a read-stream
*/
-static
+static gboolean
html_stream_eos (CamelStream *stream)
{
return TRUE;
@@ -63,17 +67,22 @@ html_stream_close (CamelStream *stream)
{
HTMLStream *html_stream = HTML_STREAM (stream);
- gtk_html_end (html_stream->gtk_html);
+ gtk_html_end (html_stream->gtk_html, html_stream->gtk_html_stream, GTK_HTML_STREAM_OK);
+}
+
+static void
+html_stream_destroy (GtkObject *object)
+{
}
static void
html_stream_class_init (GtkObjectClass *object_class)
{
- HTMLStreamClass *stream_class = (HTMLStreamClass *) object_class;
+ CamelStreamClass *stream_class = (CamelStreamClass *) object_class;
html_stream_parent_class = gtk_type_class (PARENT_TYPE);
- object_class->destory = html_stream_destroy;
+ object_class->destroy = html_stream_destroy;
stream_class->read = html_stream_read;
stream_class->write = html_stream_write;
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 2e3ac52fd2..7b0246b31c 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -10,6 +10,7 @@
#include <gnome.h>
#include "e-util/e-util.h"
#include "mail-display.h"
+#include "html-stream.h"
#define PARENT_TYPE (gtk_table_get_type ())
@@ -20,8 +21,8 @@ mail_display_init (GtkObject *object)
{
MailDisplay *mail_display = MAIL_DISPLAY (object);
- mail_display->html = gtk_html_new ();
- gtk_widget_show (mail_display->html);
+ mail_display->html = (GtkHTML *) gtk_html_new ();
+ gtk_widget_show (GTK_WIDGET (mail_display->html));
}
static void
@@ -45,12 +46,12 @@ mail_display_new (void)
MailDisplay *mail_display = gtk_type_new (mail_display_get_type ());
GtkTable *table = GTK_TABLE (mail_display);
- table->homogeous = FALSE;
+ table->homogeneous = FALSE;
gtk_table_resize (table, 1, 2);
- gtk_table_attach (table, mail_display->html,
+ gtk_table_attach (table, GTK_WIDGET (mail_display->html),
0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL);
+ GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
return GTK_WIDGET (mail_display);
}
diff --git a/mail/mail-display.h b/mail/mail-display.h
index 212592e620..cb74d5c390 100644
--- a/mail/mail-display.h
+++ b/mail/mail-display.h
@@ -2,6 +2,7 @@
#define _MAIL_DISPLAY_H_
#include <gtk/gtktable.h>
+#include <gtkhtml/gtkhtml.h>
#include "camel/camel-stream.h"
#define MAIL_DISPLAY_TYPE (mail_display_get_type ())
diff --git a/mail/main.c b/mail/main.c
index c8ab65b7a4..dc3ff752fd 100644
--- a/mail/main.c
+++ b/mail/main.c
@@ -8,6 +8,7 @@
*/
#include <config.h>
#include <gnome.h>
+#include <libgnorba/gnorba.h>
#include <bonobo/gnome-main.h>
#include "e-util/e-gui-utils.h"
#include "main.h"
@@ -31,7 +32,7 @@ init_bonobo (int argc, char **argv)
}
}
-static void
+void
main (int argc, char *argv [])
{
bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR);
@@ -41,7 +42,7 @@ main (int argc, char *argv [])
init_bonobo (argc, argv);
- mail_folder_browser_factory_init ();
+ folder_browser_factory_init ();
bonobo_main ();
diff --git a/mail/message-list.c b/mail/message-list.c
index 07959d818e..f7c54bea04 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -16,6 +16,7 @@
#include "e-table/e-cell-text.h"
#include "e-table/e-cell-toggle.h"
#include "e-table/e-cell-checkbox.h"
+#include "e-util/e-util.h"
#include "message-list.h"
#include "Mail.h"
@@ -368,17 +369,19 @@ message_list_new (void)
void
message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder)
{
+ CamelException ex;
+
g_return_if_fail (message_list != NULL);
g_return_if_fail (camel_folder != NULL);
g_return_if_fail (IS_MESSAGE_LIST (message_list));
g_return_if_fail (CAMEL_IS_FOLDER (camel_folder));
- g_return_if_fail (camel_has_summary_capability (camel_folder));
+ g_return_if_fail (camel_folder_has_summary_capability (camel_folder, &ex));
if (message_list->folder)
gtk_object_unref (GTK_OBJECT (message_list->folder));
message_list->folder = camel_folder;
- message_list->folder_summary = camel_folder_get_summary (camel_folder);
+ message_list->folder_summary = camel_folder_get_summary (camel_folder, &ex);
gtk_object_ref (GTK_OBJECT (camel_folder));