[evolution/webkit-composer: 30/30] Preliminary port of composer to EEditor, drop last Gtkhtml dependency



commit cbdc76adbc5c09563b995c9c3cdcea149dfec205
Author: Dan VrÃtil <dvratil redhat com>
Date:   Tue Aug 28 18:18:22 2012 +0200

    Preliminary port of composer to EEditor, drop last Gtkhtml dependency

 composer/Makefile.am              |    7 +-
 composer/e-composer-actions.c     |   72 +-
 composer/e-composer-actions.h     |   82 +-
 composer/e-composer-activity.c    |   18 +-
 composer/e-composer-private.c     |  149 ++-
 composer/e-composer-private.h     |    2 -
 composer/e-msg-composer.c         |  356 ++++---
 composer/e-msg-composer.h         |   16 +-
 configure.ac                      |   11 -
 widgets/misc/Makefile.am          |    3 +-
 widgets/misc/e-web-view-gtkhtml.c | 2318 -------------------------------------
 widgets/misc/e-web-view-gtkhtml.h |  173 ---
 12 files changed, 404 insertions(+), 2803 deletions(-)
---
diff --git a/composer/Makefile.am b/composer/Makefile.am
index 59b3160..63131eb 100644
--- a/composer/Makefile.am
+++ b/composer/Makefile.am
@@ -39,8 +39,7 @@ libcomposer_la_CPPFLAGS =						\
 	-DPREFIX=\"$(prefix)\"						\
 	-DG_LOG_DOMAIN=\"composer\"					\
 	$(EVOLUTION_DATA_SERVER_CFLAGS)					\
-	$(GNOME_PLATFORM_CFLAGS)					\
-	$(GTKHTML_CFLAGS)
+	$(GNOME_PLATFORM_CFLAGS)
 
 libcomposer_la_SOURCES = 			\
 	$(libcomposerinclude_HEADERS)		\
@@ -61,6 +60,7 @@ libcomposer_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
 libcomposer_la_LIBADD =					\
 	$(top_builddir)/e-util/libeutil.la		\
 	$(top_builddir)/widgets/misc/libemiscwidgets.la	\
+	$(top_builddir)/widgets/editor/libeeditor.la	\
 	$(top_builddir)/shell/libeshell.la		\
 	$(top_builddir)/em-format/libemformat.la	\
 	$(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la		\
@@ -68,8 +68,7 @@ libcomposer_la_LIBADD =					\
 	$(top_builddir)/libemail-utils/libemail-utils.la \
 	$(top_builddir)/libevolution-utils/libevolution-utils.la \
 	$(EVOLUTION_DATA_SERVER_LIBS)			\
-	$(GNOME_PLATFORM_LIBS)				\
-	$(GTKHTML_LIBS)
+	$(GNOME_PLATFORM_LIBS)
 
 ui_DATA = evolution-composer.ui
 
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c
index 966866b..02d2832 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -81,20 +81,24 @@ static void
 action_pgp_encrypt_cb (GtkToggleAction *action,
                        EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, TRUE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 }
 
 static void
 action_pgp_sign_cb (GtkToggleAction *action,
                     EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, TRUE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 }
 
 static void
@@ -149,12 +153,14 @@ static void
 action_save_cb (GtkAction *action,
                 EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor = GTKHTML_EDITOR (composer);
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	const gchar *filename;
 	gint fd;
 	GError *error = NULL;
 
-	filename = gtkhtml_editor_get_filename (editor);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	filename = e_editor_get_filename (editor);
 	if (filename == NULL) {
 		gtk_action_activate (ACTION (SAVE_AS));
 		return;
@@ -184,7 +190,7 @@ action_save_cb (GtkAction *action,
 	} else
 		close (fd);
 
-	if (!gtkhtml_editor_save (editor, filename, TRUE, &error)) {
+	if (!e_editor_save (editor, filename, TRUE, &error)) {
 		e_alert_submit (
 			E_ALERT_SINK (composer),
 			E_ALERT_NO_SAVE_FILE,
@@ -193,13 +199,15 @@ action_save_cb (GtkAction *action,
 		return;
 	}
 
-	gtkhtml_editor_run_command (GTKHTML_EDITOR (composer), "saved");
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 }
 
 static void
 action_save_as_cb (GtkAction *action,
                    EMsgComposer *composer)
 {
+	EEditor *editor;
 	GtkWidget *dialog;
 	gchar *filename;
 	gint response;
@@ -223,8 +231,9 @@ action_save_as_cb (GtkAction *action,
 	if (response != GTK_RESPONSE_OK)
 		goto exit;
 
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 	filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
-	gtkhtml_editor_set_filename (GTKHTML_EDITOR (composer), filename);
+	e_editor_set_filename (editor, filename);
 	g_free (filename);
 
 	gtk_action_activate (ACTION (SAVE));
@@ -265,20 +274,24 @@ static void
 action_smime_encrypt_cb (GtkToggleAction *action,
                          EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, TRUE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 }
 
 static void
 action_smime_sign_cb (GtkToggleAction *action,
                       EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, TRUE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 }
 
 static GtkActionEntry entries[] = {
@@ -461,15 +474,15 @@ e_composer_actions_init (EMsgComposer *composer)
 {
 	GtkActionGroup *action_group;
 	GtkUIManager *ui_manager;
-	GtkhtmlEditor *editor;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	gboolean visible;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
-	editor = GTKHTML_EDITOR (composer);
-	web_view = e_msg_composer_get_web_view (composer);
-	ui_manager = gtkhtml_editor_get_ui_manager (editor);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	ui_manager = e_editor_get_ui_manager (editor);
 
 	/* Composer Actions */
 	action_group = composer->priv->composer_actions;
@@ -513,23 +526,24 @@ e_composer_actions_init (EMsgComposer *composer)
 		ACTION (SAVE_DRAFT), "short-label", _("Save Draft"), NULL);
 
 	g_object_bind_property (
-		composer, "html-mode",
+		editor_widget, "mode",
 		ACTION (PICTURE_GALLERY), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
+	/* FIXME WEBKIT Make sure this works */
 	g_object_bind_property (
-		web_view, "editable",
-		GTKHTML_EDITOR_ACTION_EDIT_MENU (editor), "sensitive",
+		editor_widget, "editable",
+		e_editor_get_action (editor, "edit"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 	g_object_bind_property (
-		web_view, "editable",
-		GTKHTML_EDITOR_ACTION_FORMAT_MENU (editor), "sensitive",
+		editor_widget, "editable",
+		e_editor_get_action (editor, "format"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 	g_object_bind_property (
-		web_view, "editable",
-		GTKHTML_EDITOR_ACTION_INSERT_MENU (editor), "sensitive",
+		editor_widget, "editable",
+		e_editor_get_action (editor, "insert"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 #if defined (HAVE_NSS)
diff --git a/composer/e-composer-actions.h b/composer/e-composer-actions.h
index 4aed102..716c1d5 100644
--- a/composer/e-composer-actions.h
+++ b/composer/e-composer-actions.h
@@ -19,47 +19,47 @@
 #define E_COMPOSER_ACTIONS_H
 
 #define E_COMPOSER_ACTION(composer, name) \
-	(gtkhtml_editor_get_action (GTKHTML_EDITOR (composer), (name)))
+	(e_editor_get_action (E_EDITOR (editor), (name)))
 
-#define E_COMPOSER_ACTION_ATTACH(composer) \
-	E_COMPOSER_ACTION ((composer), "attach")
-#define E_COMPOSER_ACTION_CLOSE(composer) \
-	E_COMPOSER_ACTION ((composer), "close")
-#define E_COMPOSER_ACTION_PGP_ENCRYPT(composer) \
-	E_COMPOSER_ACTION ((composer), "pgp-encrypt")
-#define E_COMPOSER_ACTION_PGP_SIGN(composer) \
-	E_COMPOSER_ACTION ((composer), "pgp-sign")
-#define E_COMPOSER_ACTION_PICTURE_GALLERY(composer) \
-	E_COMPOSER_ACTION ((composer), "picture-gallery")
-#define E_COMPOSER_ACTION_PRINT(composer) \
-	E_COMPOSER_ACTION ((composer), "print")
-#define E_COMPOSER_ACTION_PRINT_PREVIEW(composer) \
-	E_COMPOSER_ACTION ((composer), "print-preview")
-#define E_COMPOSER_ACTION_PRIORITIZE_MESSAGE(composer) \
-	E_COMPOSER_ACTION ((composer), "prioritize-message")
-#define E_COMPOSER_ACTION_REQUEST_READ_RECEIPT(composer) \
-	E_COMPOSER_ACTION ((composer), "request-read-receipt")
-#define E_COMPOSER_ACTION_SAVE(composer) \
-	E_COMPOSER_ACTION ((composer), "save")
-#define E_COMPOSER_ACTION_SAVE_AS(composer) \
-	E_COMPOSER_ACTION ((composer), "save-as")
-#define E_COMPOSER_ACTION_SAVE_DRAFT(composer) \
-	E_COMPOSER_ACTION ((composer), "save-draft")
-#define E_COMPOSER_ACTION_SECURITY_MENU(composer) \
-	E_COMPOSER_ACTION ((composer), "security-menu")
-#define E_COMPOSER_ACTION_SEND(composer) \
-	E_COMPOSER_ACTION ((composer), "send")
-#define E_COMPOSER_ACTION_NEW_MESSAGE(composer) \
-	E_COMPOSER_ACTION ((composer), "new-message")
-#define E_COMPOSER_ACTION_SMIME_ENCRYPT(composer) \
-	E_COMPOSER_ACTION ((composer), "smime-encrypt")
-#define E_COMPOSER_ACTION_SMIME_SIGN(composer) \
-	E_COMPOSER_ACTION ((composer), "smime-sign")
-#define E_COMPOSER_ACTION_VIEW_BCC(composer) \
-	E_COMPOSER_ACTION ((composer), "view-bcc")
-#define E_COMPOSER_ACTION_VIEW_CC(composer) \
-	E_COMPOSER_ACTION ((composer), "view-cc")
-#define E_COMPOSER_ACTION_VIEW_REPLY_TO(composer) \
-	E_COMPOSER_ACTION ((composer), "view-reply-to")
+#define E_COMPOSER_ACTION_ATTACH(editor) \
+	E_COMPOSER_ACTION ((editor), "attach")
+#define E_COMPOSER_ACTION_CLOSE(editor) \
+	E_COMPOSER_ACTION ((editor), "close")
+#define E_COMPOSER_ACTION_PGP_ENCRYPT(editor) \
+	E_COMPOSER_ACTION ((editor), "pgp-encrypt")
+#define E_COMPOSER_ACTION_PGP_SIGN(editor) \
+	E_COMPOSER_ACTION ((editor), "pgp-sign")
+#define E_COMPOSER_ACTION_PICTURE_GALLERY(editor) \
+	E_COMPOSER_ACTION ((editor), "picture-gallery")
+#define E_COMPOSER_ACTION_PRINT(editor) \
+	E_COMPOSER_ACTION ((editor), "print")
+#define E_COMPOSER_ACTION_PRINT_PREVIEW(editor) \
+	E_COMPOSER_ACTION ((editor), "print-preview")
+#define E_COMPOSER_ACTION_PRIORITIZE_MESSAGE(editor) \
+	E_COMPOSER_ACTION ((editor), "prioritize-message")
+#define E_COMPOSER_ACTION_REQUEST_READ_RECEIPT(editor) \
+	E_COMPOSER_ACTION ((editor), "request-read-receipt")
+#define E_COMPOSER_ACTION_SAVE(editor) \
+	E_COMPOSER_ACTION ((editor), "save")
+#define E_COMPOSER_ACTION_SAVE_AS(editor) \
+	E_COMPOSER_ACTION ((editor), "save-as")
+#define E_COMPOSER_ACTION_SAVE_DRAFT(editor) \
+	E_COMPOSER_ACTION ((editor), "save-draft")
+#define E_COMPOSER_ACTION_SECURITY_MENU(editor) \
+	E_COMPOSER_ACTION ((editor), "security-menu")
+#define E_COMPOSER_ACTION_SEND(editor) \
+	E_COMPOSER_ACTION ((editor), "send")
+#define E_COMPOSER_ACTION_NEW_MESSAGE(editor) \
+	E_COMPOSER_ACTION ((editor), "new-message")
+#define E_COMPOSER_ACTION_SMIME_ENCRYPT(editor) \
+	E_COMPOSER_ACTION ((editor), "smime-encrypt")
+#define E_COMPOSER_ACTION_SMIME_SIGN(editor) \
+	E_COMPOSER_ACTION ((editor), "smime-sign")
+#define E_COMPOSER_ACTION_VIEW_BCC(editor) \
+	E_COMPOSER_ACTION ((editor), "view-bcc")
+#define E_COMPOSER_ACTION_VIEW_CC(editor) \
+	E_COMPOSER_ACTION ((editor), "view-cc")
+#define E_COMPOSER_ACTION_VIEW_REPLY_TO(editor) \
+	E_COMPOSER_ACTION ((editor), "view-reply-to")
 
 #endif /* E_COMPOSER_ACTIONS_H */
diff --git a/composer/e-composer-activity.c b/composer/e-composer-activity.c
index a74e5cd..fb40a3a 100644
--- a/composer/e-composer-activity.c
+++ b/composer/e-composer-activity.c
@@ -46,14 +46,16 @@ composer_activity_lock_interface (EComposerActivity *activity)
 {
 	GtkActionGroup *action_group;
 	EMsgComposer *composer;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	gboolean editable;
 
 	composer = e_composer_activity_get_composer (activity);
 
-	web_view = e_msg_composer_get_web_view (composer);
-	editable = e_web_view_gtkhtml_get_editable (web_view);
-	e_web_view_gtkhtml_set_editable (web_view, FALSE);
+	editor = e_msg_composer_get_editor (composer);
+	editor_widget = e_editor_get_editor_widget (editor);
+	editable = webkit_web_view_get_editable (WEBKIT_WEB_VIEW (editor_widget));
+	webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), FALSE);
 	activity->priv->saved_editable = editable;
 
 	action_group = composer->priv->async_actions;
@@ -65,14 +67,16 @@ composer_activity_unlock_interface (EComposerActivity *activity)
 {
 	GtkActionGroup *action_group;
 	EMsgComposer *composer;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	gboolean editable;
 
 	composer = e_composer_activity_get_composer (activity);
 
 	editable = activity->priv->saved_editable;
-	web_view = e_msg_composer_get_web_view (composer);
-	e_web_view_gtkhtml_set_editable (web_view, editable);
+	editor = e_msg_composer_get_editor (composer);
+	editor_widget = e_editor_get_editor_widget (editor);
+	webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), editable);
 
 	action_group = composer->priv->async_actions;
 	gtk_action_group_set_sensitive (action_group, TRUE);
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index f6fd7d9..c63f68b 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -31,12 +31,14 @@
 static void
 composer_setup_charset_menu (EMsgComposer *composer)
 {
+ 	EEditor *editor;
 	GtkUIManager *ui_manager;
 	const gchar *path;
 	GList *list;
 	guint merge_id;
 
-	ui_manager = gtkhtml_editor_get_ui_manager (GTKHTML_EDITOR (composer));
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	ui_manager = e_editor_get_ui_manager (editor);
 	path = "/main-menu/options-menu/charset-menu";
 	merge_id = gtk_ui_manager_new_merge_id (ui_manager);
 
@@ -58,6 +60,7 @@ composer_setup_charset_menu (EMsgComposer *composer)
 	gtk_ui_manager_ensure_update (ui_manager);
 }
 
+/* FIXME WEBKIT We don't need to control this anymore....
 static void
 msg_composer_url_requested_cb (GtkHTML *html,
                                const gchar *uri,
@@ -78,8 +81,8 @@ msg_composer_url_requested_cb (GtkHTML *html,
 		mime_part = g_hash_table_lookup (hash_table, uri);
 	}
 
-	/* If this is not an inline image request,
-	 * allow the signal emission to continue. */
+	// If this is not an inline image request,
+	// allow the signal emission to continue. 
 	if (mime_part == NULL)
 		return;
 
@@ -95,26 +98,29 @@ msg_composer_url_requested_cb (GtkHTML *html,
 
 	g_object_unref (camel_stream);
 
-	/* gtk_html_end() destroys the GtkHTMLStream, so we need to
-	 * stop the signal emission so nothing else tries to use it. */
+	// gtk_html_end() destroys the GtkHTMLStream, so we need to
+	// stop the signal emission so nothing else tries to use it.
 	g_signal_stop_emission_by_name (html, "url-requested");
 }
+*/
 
 static void
 composer_update_gallery_visibility (EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GtkToggleAction *toggle_action;
 	gboolean gallery_active;
-	gboolean html_mode;
+	EEditorWidgetMode mode;
 
-	editor = GTKHTML_EDITOR (composer);
-	html_mode = gtkhtml_editor_get_html_mode (editor);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	mode = e_editor_widget_get_mode (editor_widget);
 
 	toggle_action = GTK_TOGGLE_ACTION (ACTION (PICTURE_GALLERY));
 	gallery_active = gtk_toggle_action_get_active (toggle_action);
 
-	if (html_mode && gallery_active) {
+	if ((mode == E_EDITOR_WIDGET_MODE_HTML) && gallery_active) {
 		gtk_widget_show (composer->priv->gallery_scrolled_window);
 		gtk_widget_show (composer->priv->gallery_icon_view);
 	} else {
@@ -141,9 +147,9 @@ e_composer_private_constructed (EMsgComposer *composer)
 	EFocusTracker *focus_tracker;
 	EShell *shell;
 	EShellSettings *shell_settings;
-	EWebViewGtkHTML *web_view;
 	ESourceRegistry *registry;
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GtkUIManager *ui_manager;
 	GtkAction *action;
 	GtkWidget *container;
@@ -157,13 +163,13 @@ e_composer_private_constructed (EMsgComposer *composer)
 	GError *error = NULL;
 	EComposerHeader *header;
 
-	editor = GTKHTML_EDITOR (composer);
-	ui_manager = gtkhtml_editor_get_ui_manager (editor);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	ui_manager = e_editor_get_ui_manager (editor);
+	editor_widget = e_editor_get_editor_widget (editor);
 
 	shell = e_msg_composer_get_shell (composer);
 	registry = e_shell_get_registry (shell);
 	shell_settings = e_shell_get_shell_settings (shell);
-	web_view = e_msg_composer_get_web_view (composer);
 	small_screen_mode = e_shell_get_small_screen_mode (shell);
 
 	if (small_screen_mode) {
@@ -180,7 +186,7 @@ e_composer_private_constructed (EMsgComposer *composer)
 		widget = gtkhtml_editor_get_managed_widget (editor, "/main-menu");
 		gtk_widget_hide (widget);
 #endif
-		widget = gtkhtml_editor_get_managed_widget (editor, "/main-toolbar");
+		widget = e_editor_get_managed_widget (editor, "/main-toolbar");
 		gtk_toolbar_set_style (
 			GTK_TOOLBAR (widget), GTK_TOOLBAR_BOTH_HORIZ);
 		gtk_widget_hide (widget);
@@ -236,21 +242,22 @@ e_composer_private_constructed (EMsgComposer *composer)
 
 	focus_tracker = e_focus_tracker_new (GTK_WINDOW (composer));
 
-	action = gtkhtml_editor_get_action (editor, "cut");
+	action = e_editor_get_action (editor, "cut");
 	e_focus_tracker_set_cut_clipboard_action (focus_tracker, action);
 
-	action = gtkhtml_editor_get_action (editor, "copy");
+	action = e_editor_get_action (editor, "copy");
 	e_focus_tracker_set_copy_clipboard_action (focus_tracker, action);
 
-	action = gtkhtml_editor_get_action (editor, "paste");
+	action = e_editor_get_action (editor, "paste");
 	e_focus_tracker_set_paste_clipboard_action (focus_tracker, action);
 
-	action = gtkhtml_editor_get_action (editor, "select-all");
+	action = e_editor_get_action (editor, "select-all");
 	e_focus_tracker_set_select_all_action (focus_tracker, action);
 
 	priv->focus_tracker = focus_tracker;
 
-	container = editor->vbox;
+	container = gtk_hbox_new (FALSE, 0);
+	e_editor_window_pack_above (E_EDITOR_WINDOW (composer), container);
 
 	/* Construct the activity bar. */
 
@@ -271,10 +278,13 @@ e_composer_private_constructed (EMsgComposer *composer)
 	widget = e_composer_header_table_new (shell, registry);
 	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+	e_editor_window_pack_above (E_EDITOR_WINDOW (composer), widget);
+	/* FIXME WEBKIT
 	if (small_screen_mode)
 		gtk_box_reorder_child (GTK_BOX (container), widget, 1);
 	else
 		gtk_box_reorder_child (GTK_BOX (container), widget, 2);
+	*/
 	priv->header_table = g_object_ref (widget);
 	gtk_widget_show (widget);
 
@@ -297,15 +307,16 @@ e_composer_private_constructed (EMsgComposer *composer)
 	}
 
 	widget = e_attachment_paned_new ();
-	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+	e_editor_window_pack_below (E_EDITOR_WINDOW (composer), widget);
 	priv->attachment_paned = g_object_ref (widget);
 	gtk_widget_show (widget);
 
 	g_object_bind_property (
-		web_view, "editable",
+		editor_widget, "editable",
 		widget, "editable",
 		G_BINDING_SYNC_CREATE);
 
+	/* FIXME WEBKIT Port this if small_screen_mode works */
 	if (small_screen_mode) {
 		GtkWidget *tmp, *tmp1, *tmp_box, *container;
 		GtkWidget *combo;
@@ -381,13 +392,6 @@ e_composer_private_constructed (EMsgComposer *composer)
 	priv->gallery_scrolled_window = g_object_ref (widget);
 	gtk_widget_show (widget);
 
-	/* Reparent the scrolled window containing the GtkHTML widget
-	 * into the content area of the top attachment pane. */
-
-	widget = GTK_WIDGET (web_view);
-	widget = gtk_widget_get_parent (widget);
-	gtk_widget_reparent (widget, container);
-
 	/* Construct the picture gallery. */
 
 	container = priv->gallery_scrolled_window;
@@ -408,7 +412,9 @@ e_composer_private_constructed (EMsgComposer *composer)
 		G_CALLBACK (composer_update_gallery_visibility), composer);
 
 	/* XXX What is this for? */
+	/* FIXME WEBKIT Yes, what is this for?
 	g_object_set_data (G_OBJECT (composer), "vbox", editor->vbox);
+	*/
 
 	/* Bind headers to their corresponding actions. */
 
@@ -460,10 +466,11 @@ e_composer_private_constructed (EMsgComposer *composer)
 	 *     we'll stop the signal emission to prevent EWebView from
 	 *     launching an async operation.  Messy, but works until we
 	 *     switch to WebKit.  --mbarnes */
-
+	/* FIXME WEBKIT So...we don't need this anymore, right?
 	g_signal_connect (
 		web_view, "url-requested",
 		G_CALLBACK (msg_composer_url_requested_cb), composer);
+	*/
 }
 
 void
@@ -698,7 +705,9 @@ gboolean
 e_composer_paste_html (EMsgComposer *composer,
                        GtkClipboard *clipboard)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
+	EEditorSelection *editor_selection;
 	gchar *html;
 
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
@@ -707,8 +716,10 @@ e_composer_paste_html (EMsgComposer *composer,
 	html = e_clipboard_wait_for_html (clipboard);
 	g_return_val_if_fail (html != NULL, FALSE);
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_insert_html (editor, html);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	editor_selection = e_editor_widget_get_selection (editor_widget);
+	e_editor_selection_insert_html (editor_selection, html);
 
 	g_free (html);
 
@@ -719,7 +730,8 @@ gboolean
 e_composer_paste_image (EMsgComposer *composer,
                         GtkClipboard *clipboard)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	EAttachmentStore *store;
 	EAttachmentView *view;
 	GdkPixbuf *pixbuf = NULL;
@@ -731,7 +743,6 @@ e_composer_paste_image (EMsgComposer *composer,
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
 	g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), FALSE);
 
-	editor = GTKHTML_EDITOR (composer);
 	view = e_msg_composer_get_attachment_view (composer);
 	store = e_attachment_view_get_store (view);
 
@@ -761,9 +772,14 @@ e_composer_paste_image (EMsgComposer *composer,
 
 	/* In HTML mode, paste the image into the message body.
 	 * In text mode, add the image to the attachment store. */
-	if (gtkhtml_editor_get_html_mode (editor))
-		gtkhtml_editor_insert_image (editor, uri);
-	else {
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	if (e_editor_widget_get_mode (editor_widget) == E_EDITOR_WIDGET_MODE_HTML) {
+		EEditorSelection *selection;
+
+		selection = e_editor_widget_get_selection (editor_widget);
+		e_editor_selection_insert_image (selection, uri);
+	} else {
 		EAttachment *attachment;
 
 		attachment = e_attachment_new_for_uri (uri);
@@ -793,7 +809,9 @@ gboolean
 e_composer_paste_text (EMsgComposer *composer,
                        GtkClipboard *clipboard)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
+	EEditorSelection *editor_selection;
 	gchar *text;
 
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
@@ -802,8 +820,10 @@ e_composer_paste_text (EMsgComposer *composer,
 	text = gtk_clipboard_wait_for_text (clipboard);
 	g_return_val_if_fail (text != NULL, FALSE);
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_insert_text (editor, text);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	editor_selection = e_editor_widget_get_selection (editor_widget);
+	e_editor_selection_insert_text (editor_selection, text);
 
 	g_free (text);
 
@@ -951,6 +971,7 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
                             GAsyncResult *result,
                             EMsgComposer *composer)
 {
+	/* FIXME WEBKIT Uuuhm, yeah...we don't support signatures yet
 	GString *html_buffer = NULL;
 	GtkhtmlEditor *editor;
 	gchar *contents = NULL;
@@ -964,15 +985,15 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
 	e_mail_signature_combo_box_load_selected_finish (
 		combo_box, result, &contents, &length, &is_html, &error);
 
-	/* FIXME Use an EAlert here. */
+	// FIXME Use an EAlert here.
 	if (error != NULL) {
 		g_warning ("%s: %s", G_STRFUNC, error->message);
 		g_error_free (error);
 		goto exit;
 	}
 
-	/* "Edit as New Message" sets "priv->is_from_message".
-	 * Always put the signature at the bottom for that case. */
+	// "Edit as New Message" sets "priv->is_from_message".
+	//Always put the signature at the bottom for that case. 
 	top_signature =
 		use_top_signature (composer) &&
 		!composer->priv->is_from_message;
@@ -980,11 +1001,11 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
 	if (contents == NULL)
 		goto insert;
 
-	/* Generate HTML code for the signature. */
+	// Generate HTML code for the signature.
 
 	html_buffer = g_string_sized_new (1024);
 
-	/* The combo box active ID is the signature's ESource UID. */
+	// The combo box active ID is the signature's ESource UID.
 	active_id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (combo_box));
 
 	if (active_id != NULL && *active_id != '\0')
@@ -1006,10 +1027,9 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
 	if (!is_html)
 		g_string_append (html_buffer, "<PRE>\n");
 
-	/* The signature dash convention ("-- \n") is specified
-	 * in the "Son of RFC 1036", section 4.3.2.
-	 * http://www.chemie.fu-berlin.de/outerspace/netnews/son-of-1036.html
-	 */
+	// The signature dash convention ("-- \n") is specified
+	//in the "Son of RFC 1036", section 4.3.2.
+	//http://www.chemie.fu-berlin.de/outerspace/netnews/son-of-1036.html
 	if (add_signature_delimiter (composer)) {
 		const gchar *delim;
 		const gchar *delim_nl;
@@ -1022,11 +1042,11 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
 			delim_nl = "\n-- \n";
 		}
 
-		/* Skip the delimiter if the signature already has one. */
+		// Skip the delimiter if the signature already has one.
 		if (g_ascii_strncasecmp (contents, delim, strlen (delim)) == 0)
-			;  /* skip */
+			;  // skip
 		else if (e_util_strstrcase (contents, delim_nl) != NULL)
-			;  /* skip */
+			;  // skip
 		else
 			g_string_append (html_buffer, delim);
 	}
@@ -1045,12 +1065,12 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
 	g_free (contents);
 
 insert:
-	/* Remove the old signature and insert the new one. */
+	// Remove the old signature and insert the new one.
 
 	editor = GTKHTML_EDITOR (composer);
 
-	/* This prevents our command before/after callbacks from
-	 * screwing around with the signature as we insert it. */
+	// This prevents our command before/after callbacks from
+	   screwing around with the signature as we insert it.
 	composer->priv->in_signature_insert = TRUE;
 
 	gtkhtml_editor_freeze (editor);
@@ -1082,7 +1102,7 @@ insert:
 		g_string_free (html_buffer, TRUE);
 
 	} else if (top_signature) {
-		/* Insert paragraph after the signature ClueFlow stuff. */
+		// Insert paragraph after the signature ClueFlow stuff. 
 		if (gtkhtml_editor_run_command (editor, "cursor-forward"))
 			gtkhtml_editor_run_command (editor, "insert-paragraph");
 	}
@@ -1095,30 +1115,33 @@ insert:
 
 exit:
 	g_object_unref (composer);
+	*/
 }
 
 void
 e_composer_update_signature (EMsgComposer *composer)
 {
+	/* FIXME WEBKIT As said above...no signatures yet
 	EComposerHeaderTable *table;
 	EMailSignatureComboBox *combo_box;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
-	/* Do nothing if we're redirecting a message. */
+	// Do nothing if we're redirecting a message.
 	if (composer->priv->redirect)
 		return;
 
 	table = e_msg_composer_get_header_table (composer);
 	combo_box = e_composer_header_table_get_signature_combo_box (table);
 
-	/* XXX Signature files should be local and therefore load quickly,
-	 *     so while we do load them asynchronously we don't allow for
-	 *     user cancellation and we keep the composer alive until the
-	 *     asynchronous loading is complete. */
+	//XXX Signature files should be local and therefore load quickly,
+	//	so while we do load them asynchronously we don't allow for
+	//	user cancellation and we keep the composer alive until the
+	//	asynchronous loading is complete.
 	e_mail_signature_combo_box_load_selected (
 		combo_box, G_PRIORITY_DEFAULT, NULL,
 		(GAsyncReadyCallback) composer_load_signature_cb,
 		g_object_ref (composer));
+	*/
 }
 
diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h
index 4370b1a..14bb857 100644
--- a/composer/e-composer-private.h
+++ b/composer/e-composer-private.h
@@ -51,7 +51,6 @@
 #include "widgets/misc/e-mail-signature-combo-box.h"
 #include "widgets/misc/e-picture-gallery.h"
 #include "widgets/misc/e-preferences-window.h"
-#include "widgets/misc/e-web-view-gtkhtml.h"
 #include "shell/e-shell.h"
 
 #ifdef HAVE_XFREE
@@ -78,7 +77,6 @@ struct _EMsgComposerPrivate {
 	gpointer shell;  /* weak pointer */
 
 	/*** UI Management ***/
-
 	GtkWidget *header_table;
 	GtkWidget *activity_bar;
 	GtkWidget *alert_bar;
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index e6c6442..0d55c8f 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -36,6 +36,7 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <fcntl.h>
+#include <enchant/enchant.h>
 
 #include <libevolution-utils/e-alert-dialog.h>
 #include <e-util/e-dialog-utils.h>
@@ -47,6 +48,8 @@
 #include <em-format/e-mail-parser.h>
 #include <em-format/e-mail-formatter-quote.h>
 
+#include <e-util/e-spell-checker.h>
+
 #include <shell/e-shell.h>
 
 typedef struct _AsyncContext AsyncContext;
@@ -133,7 +136,7 @@ static void	e_msg_composer_alert_sink_init	(EAlertSinkInterface *interface);
 G_DEFINE_TYPE_WITH_CODE (
 	EMsgComposer,
 	e_msg_composer,
-	GTKHTML_TYPE_EDITOR,
+	E_TYPE_EDITOR_WINDOW,
 	G_IMPLEMENT_INTERFACE (
 		E_TYPE_ALERT_SINK, e_msg_composer_alert_sink_init)
 	G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
@@ -1059,7 +1062,6 @@ composer_build_message (EMsgComposer *composer,
 	EMsgComposerPrivate *priv;
 	GSimpleAsyncResult *simple;
 	AsyncContext *context;
-	GtkhtmlEditor *editor;
 	EAttachmentView *view;
 	EAttachmentStore *store;
 	EComposerHeaderTable *table;
@@ -1082,7 +1084,6 @@ composer_build_message (EMsgComposer *composer,
 	gint i;
 
 	priv = composer->priv;
-	editor = GTKHTML_EDITOR (composer);
 	table = e_msg_composer_get_header_table (composer);
 	view = e_msg_composer_get_attachment_view (composer);
 	store = e_attachment_view_get_store (view);
@@ -1214,11 +1215,14 @@ composer_build_message (EMsgComposer *composer,
 
 	} else {
 		gchar *text;
-		gsize length;
+		EEditor *editor;
+		EEditorWidget *editor_widget;
 
+		editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+		editor_widget = e_editor_get_editor_widget (editor);
 		data = g_byte_array_new ();
-		text = gtkhtml_editor_get_text_plain (editor, &length);
-		g_byte_array_append (data, (guint8 *) text, (guint) length);
+		text = e_editor_widget_get_text_plain (editor_widget);
+		g_byte_array_append (data, (guint8 *) text, strlen (text));
 		g_free (text);
 
 		type = camel_content_type_new ("text", "plain");
@@ -1281,20 +1285,29 @@ composer_build_message (EMsgComposer *composer,
 		gchar *text;
 		gsize length;
 		gboolean pre_encode;
+		EEditor *editor;
+		EEditorWidget *editor_widget;
 
 		clear_current_images (composer);
 
+		/* FIXME WEBKIT Can this go away?
 		if (flags & COMPOSER_FLAG_SAVE_OBJECT_DATA)
 			gtkhtml_editor_run_command (editor, "save-data-on");
+		*/
 
+		editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+		editor_widget = e_editor_get_editor_widget (editor);
 		data = g_byte_array_new ();
-		text = gtkhtml_editor_get_text_html (editor, &length);
+		text = e_editor_widget_get_text_html (editor_widget);
+		length = strlen (text);
 		g_byte_array_append (data, (guint8 *) text, (guint) length);
 		pre_encode = text_requires_quoted_printable (text, length);
 		g_free (text);
 
+		/* FIXME WEBKIT And this as well?
 		if (flags & COMPOSER_FLAG_SAVE_OBJECT_DATA)
 			gtkhtml_editor_run_command (editor, "save-data-off");
+		*/
 
 		mem_stream = camel_stream_mem_new_with_byte_array (data);
 		stream = camel_stream_filter_new (mem_stream);
@@ -1469,6 +1482,7 @@ use_top_signature (EMsgComposer *composer)
 		shell_settings, "composer-top-signature");
 }
 
+/* FIXME WEBKIT Nope....*/
 #define NO_SIGNATURE_TEXT	\
 	"<!--+GtkHTML:<DATA class=\"ClueFlow\" " \
 	"                     key=\"signature\" " \
@@ -1483,6 +1497,8 @@ set_editor_text (EMsgComposer *composer,
                  gboolean set_signature)
 {
 	gchar *body = NULL;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 	g_return_if_fail (text != NULL);
@@ -1511,7 +1527,9 @@ set_editor_text (EMsgComposer *composer,
 		body = g_strdup_printf ("%s<BR>", text);
 	}
 
-	gtkhtml_editor_set_text_html (GTKHTML_EDITOR (composer), body, -1);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_text_html (editor_widget, body);
 
 	if (set_signature)
 		e_composer_update_signature (composer);
@@ -1524,12 +1542,14 @@ set_editor_text (EMsgComposer *composer,
 static void
 attachment_store_changed_cb (EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
 	/* Mark the editor as changed so it prompts about unsaved
 	 * changes on close. */
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, TRUE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 }
 
 static void
@@ -1556,6 +1576,7 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
 	ESourceMailComposition *mc;
 	ESourceOpenPGP *pgp;
 	ESourceSMIME *smime;
+	EEditor *editor;
 	EComposerHeaderTable *table;
 	GtkToggleAction *action;
 	ESource *source;
@@ -1566,6 +1587,7 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
 	const gchar *extension_name;
 	const gchar *uid;
 
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 	table = e_msg_composer_get_header_table (composer);
 	registry = e_composer_header_table_get_registry (table);
 	uid = e_composer_header_table_get_identity_uid (table);
@@ -1615,11 +1637,13 @@ msg_composer_paste_clipboard_targets_cb (GtkClipboard *clipboard,
                                          gint n_targets,
                                          EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
-	gboolean html_mode;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
+	EEditorWidgetMode mode;
 
-	editor = GTKHTML_EDITOR (composer);
-	html_mode = gtkhtml_editor_get_html_mode (editor);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	mode = e_editor_widget_get_mode (editor_widget);
 
 	/* Order is important here to ensure common use cases are
 	 * handled correctly.  See GNOME bug #603715 for details. */
@@ -1630,7 +1654,7 @@ msg_composer_paste_clipboard_targets_cb (GtkClipboard *clipboard,
 	}
 
 	/* Only paste HTML content in HTML mode. */
-	if (html_mode) {
+	if (mode == E_EDITOR_WIDGET_MODE_HTML) {
 		if (e_targets_include_html (targets, n_targets)) {
 			e_composer_paste_html (composer, clipboard);
 			return;
@@ -1649,7 +1673,7 @@ msg_composer_paste_clipboard_targets_cb (GtkClipboard *clipboard,
 }
 
 static void
-msg_composer_paste_clipboard_cb (EWebViewGtkHTML *web_view,
+msg_composer_paste_clipboard_cb (EEditorWidget *web_view,
                                  EMsgComposer *composer)
 {
 	GtkClipboard *clipboard;
@@ -1663,6 +1687,7 @@ msg_composer_paste_clipboard_cb (EWebViewGtkHTML *web_view,
 	g_signal_stop_emission_by_name (web_view, "paste-clipboard");
 }
 
+/* FIXME WEBKIT Is this still valid problem? */
 static void
 msg_composer_realize_gtkhtml_cb (GtkWidget *widget,
                                  EMsgComposer *composer)
@@ -1679,8 +1704,10 @@ msg_composer_realize_gtkhtml_cb (GtkWidget *widget,
 
 	/* When redirecting a message, the message body is not
 	 * editable and therefore cannot be a drag destination. */
+	/*
 	if (!e_web_view_gtkhtml_get_editable (E_WEB_VIEW_GTKHTML (widget)))
 		return;
+	*/
 
 	view = e_msg_composer_get_attachment_view (composer);
 
@@ -1722,9 +1749,16 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
                                     EMsgComposer *composer)
 {
 	EAttachmentView *view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
+	EEditorWidgetMode mode;
+
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	mode = e_editor_widget_get_mode (editor_widget);
 
 	/* HTML mode has a few special cases for drops... */
-	if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer))) {
+	if (mode == E_EDITOR_WIDGET_MODE_HTML) {
 
 		/* If we're receiving an image, we want the image to be
 		 * inserted in the message body.  Let GtkHtml handle it. */
@@ -1755,20 +1789,24 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
 static void
 msg_composer_notify_header_cb (EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, TRUE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed(editor_widget, TRUE);
 }
 
 static gboolean
 msg_composer_delete_event_cb (EMsgComposer *composer)
 {
+	EEditor *editor;
 	EShell *shell;
 	GtkApplication *application;
 	GList *windows;
 
 	shell = e_msg_composer_get_shell (composer);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
 	/* If the "async" action group is insensitive, it means an
 	 * asynchronous operation is in progress.  Block the event. */
@@ -1796,6 +1834,10 @@ msg_composer_prepare_for_quit_cb (EShell *shell,
                                   EActivity *activity,
                                   EMsgComposer *composer)
 {
+	EEditor *editor;
+
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+
 	if (e_msg_composer_is_exiting (composer)) {
 		/* needs save draft first */
 		g_object_ref (activity);
@@ -1922,18 +1964,17 @@ msg_composer_constructed (GObject *object)
 {
 	EShell *shell;
 	EShellSettings *shell_settings;
-	GtkhtmlEditor *editor;
 	EMsgComposer *composer;
 	EAttachmentView *view;
 	EAttachmentStore *store;
 	EComposerHeaderTable *table;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GtkUIManager *ui_manager;
 	GtkToggleAction *action;
 	const gchar *id;
 	gboolean active;
 
-	editor = GTKHTML_EDITOR (object);
 	composer = E_MSG_COMPOSER (object);
 
 	shell = e_msg_composer_get_shell (composer);
@@ -1946,8 +1987,9 @@ msg_composer_constructed (GObject *object)
 
 	e_composer_private_constructed (composer);
 
-	web_view = e_msg_composer_get_web_view (composer);
-	ui_manager = gtkhtml_editor_get_ui_manager (editor);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	ui_manager = e_editor_get_ui_manager (editor);
 	view = e_msg_composer_get_attachment_view (composer);
 	table = E_COMPOSER_HEADER_TABLE (composer->priv->header_table);
 
@@ -1989,21 +2031,21 @@ msg_composer_constructed (GObject *object)
 	/* Clipboard Support */
 
 	g_signal_connect (
-		web_view, "paste-clipboard",
+		editor_widget, "paste-clipboard",
 		G_CALLBACK (msg_composer_paste_clipboard_cb), composer);
 
 	/* Drag-and-Drop Support */
 
 	g_signal_connect (
-		web_view, "realize",
+		editor_widget, "realize",
 		G_CALLBACK (msg_composer_realize_gtkhtml_cb), composer);
 
 	g_signal_connect (
-		web_view, "drag-motion",
+		editor_widget, "drag-motion",
 		G_CALLBACK (msg_composer_drag_motion_cb), composer);
 
 	g_signal_connect (
-		web_view, "drag-data-received",
+		editor_widget, "drag-data-received",
 		G_CALLBACK (msg_composer_drag_data_received_cb), composer);
 
 	g_signal_connect (
@@ -2052,7 +2094,7 @@ msg_composer_constructed (GObject *object)
 		G_CALLBACK (attachment_store_changed_cb), composer);
 
 	/* Initialization may have tripped the "changed" state. */
-	gtkhtml_editor_set_changed (editor, FALSE);
+	e_editor_widget_set_changed (editor_widget, FALSE);
 
 	id = "org.gnome.evolution.composer";
 	e_plugin_ui_register_manager (ui_manager, id, composer);
@@ -2094,6 +2136,8 @@ msg_composer_map (GtkWidget *widget)
 {
 	EComposerHeaderTable *table;
 	GtkWidget *input_widget;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	const gchar *text;
 
 	/* Chain up to parent's map() method. */
@@ -2122,7 +2166,9 @@ msg_composer_map (GtkWidget *widget)
 	}
 
 	/* Jump to the editor as a last resort. */
-	gtkhtml_editor_run_command (GTKHTML_EDITOR (widget), "grab-focus");
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (widget));
+	editor_widget = e_editor_get_editor_widget (editor);
+	gtk_widget_grab_focus (GTK_WIDGET (editor_widget));
 }
 
 static gboolean
@@ -2131,12 +2177,12 @@ msg_composer_key_press_event (GtkWidget *widget,
 {
 	EMsgComposer *composer = E_MSG_COMPOSER (widget);
 	GtkWidget *input_widget;
-	GtkhtmlEditor *editor;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
-	editor = GTKHTML_EDITOR (widget);
 	composer = E_MSG_COMPOSER (widget);
-	web_view = e_msg_composer_get_web_view (composer);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
 
 	input_widget =
 		e_composer_header_table_get_header (
@@ -2156,12 +2202,12 @@ msg_composer_key_press_event (GtkWidget *widget,
 	}
 
 	if (event->keyval == GDK_KEY_Tab && gtk_widget_is_focus (input_widget)) {
-		gtkhtml_editor_run_command (editor, "grab-focus");
+		gtk_widget_grab_focus (GTK_WIDGET (editor_widget));
 		return TRUE;
 	}
 
 	if (event->keyval == GDK_KEY_ISO_Left_Tab &&
-		gtk_widget_is_focus (GTK_WIDGET (web_view))) {
+		gtk_widget_is_focus (GTK_WIDGET (editor_widget))) {
 		gtk_widget_grab_focus (input_widget);
 		return TRUE;
 	}
@@ -2172,33 +2218,36 @@ msg_composer_key_press_event (GtkWidget *widget,
 }
 
 static void
-msg_composer_cut_clipboard (GtkhtmlEditor *editor)
+msg_composer_cut_clipboard (EMsgComposer *composer)
 {
 	/* Do nothing.  EFocusTracker handles this. */
 }
 
 static void
-msg_composer_copy_clipboard (GtkhtmlEditor *editor)
+msg_composer_copy_clipboard (EMsgComposer *composer)
 {
 	/* Do nothing.  EFocusTracker handles this. */
 }
 
 static void
-msg_composer_paste_clipboard (GtkhtmlEditor *editor)
+msg_composer_paste_clipboard (EMsgComposer *composer)
 {
 	/* Do nothing.  EFocusTracker handles this. */
 }
 
 static void
-msg_composer_select_all (GtkhtmlEditor *editor)
+msg_composer_select_all (EMsgComposer *composer)
 {
 	/* Do nothing.  EFocusTracker handles this. */
 }
 
+/* FIXME WEBKIT We can effectively hack around this by DOM manipulation
+ * when inserting signature, right?..or when is this usefull ?? */
 static void
-msg_composer_command_before (GtkhtmlEditor *editor,
+msg_composer_command_before (EMsgComposer *composer,
                              const gchar *command)
 {
+	/*
 	EMsgComposer *composer;
 	const gchar *data;
 
@@ -2222,12 +2271,14 @@ msg_composer_command_before (GtkhtmlEditor *editor,
 		gtkhtml_editor_run_command (editor, "text-default-color");
 		gtkhtml_editor_run_command (editor, "italic-off");
 	}
+	*/
 }
 
 static void
-msg_composer_command_after (GtkhtmlEditor *editor,
+msg_composer_command_after (EMsgComposer *composer,
                             const gchar *command)
 {
+	/*
 	EMsgComposer *composer;
 	const gchar *data;
 
@@ -2250,7 +2301,7 @@ msg_composer_command_after (GtkhtmlEditor *editor,
 	if (data == NULL || *data != '1')
 		return;
 
-	/* Clear the signature. */
+	// Clear the signature.
 	if (gtkhtml_editor_is_paragraph_empty (editor))
 		gtkhtml_editor_set_paragraph_data (editor, "signature" ,"0");
 
@@ -2263,19 +2314,17 @@ msg_composer_command_after (GtkhtmlEditor *editor,
 
 	gtkhtml_editor_run_command (editor, "text-default-color");
 	gtkhtml_editor_run_command (editor, "italic-off");
+	*/
 }
 
 static gchar *
-msg_composer_image_uri (GtkhtmlEditor *editor,
+msg_composer_image_uri (EMsgComposer *composer,
                         const gchar *uri)
 {
-	EMsgComposer *composer;
 	GHashTable *hash_table;
 	CamelMimePart *part;
 	const gchar *cid;
 
-	composer = E_MSG_COMPOSER (editor);
-
 	hash_table = composer->priv->inline_images_by_url;
 	part = g_hash_table_lookup (hash_table, uri);
 
@@ -2301,9 +2350,11 @@ msg_composer_image_uri (GtkhtmlEditor *editor,
 	return g_strconcat ("cid:", cid, NULL);
 }
 
+/* FIXME WEBKIT We don't need this, do we? */
 static void
-msg_composer_object_deleted (GtkhtmlEditor *editor)
+msg_composer_object_deleted (EMsgComposer *composer)
 {
+	/*
 	const gchar *data;
 
 	if (!gtkhtml_editor_is_paragraph_empty (editor))
@@ -2323,6 +2374,7 @@ msg_composer_object_deleted (GtkhtmlEditor *editor)
 	data = gtkhtml_editor_get_paragraph_data (editor, "signature");
 	if (data != NULL && *data == '1')
 		gtkhtml_editor_set_paragraph_data (editor, "signature", "0");
+	*/
 }
 
 static gboolean
@@ -2376,37 +2428,25 @@ msg_composer_accumulator_false_abort (GSignalInvocationHint *ihint,
 }
 
 static void
-e_msg_composer_class_init (EMsgComposerClass *class)
+e_msg_composer_class_init (EMsgComposerClass *klass)
 {
 	GObjectClass *object_class;
 	GtkWidgetClass *widget_class;
-	GtkhtmlEditorClass *editor_class;
 
-	g_type_class_add_private (class, sizeof (EMsgComposerPrivate));
+	g_type_class_add_private (klass, sizeof (EMsgComposerPrivate));
 
-	object_class = G_OBJECT_CLASS (class);
+	object_class = G_OBJECT_CLASS (klass);
 	object_class->set_property = msg_composer_set_property;
 	object_class->get_property = msg_composer_get_property;
 	object_class->dispose = msg_composer_dispose;
 	object_class->finalize = msg_composer_finalize;
 	object_class->constructed = msg_composer_constructed;
 
-	widget_class = GTK_WIDGET_CLASS (class);
+	widget_class = GTK_WIDGET_CLASS (klass);
 	widget_class->map = msg_composer_map;
 	widget_class->key_press_event = msg_composer_key_press_event;
 
-	editor_class = GTKHTML_EDITOR_CLASS (class);
-	editor_class->cut_clipboard = msg_composer_cut_clipboard;
-	editor_class->copy_clipboard = msg_composer_copy_clipboard;
-	editor_class->paste_clipboard = msg_composer_paste_clipboard;
-	editor_class->select_all = msg_composer_select_all;
-	editor_class->command_before = msg_composer_command_before;
-	editor_class->command_after = msg_composer_command_after;
-	editor_class->image_uri = msg_composer_image_uri;
-	editor_class->link_clicked = NULL; /* EWebView handles this */
-	editor_class->object_deleted = msg_composer_object_deleted;
-
-	class->presend = msg_composer_presend;
+	klass->presend = msg_composer_presend;
 
 	g_object_class_install_property (
 		object_class,
@@ -2431,7 +2471,7 @@ e_msg_composer_class_init (EMsgComposerClass *class)
 
 	signals[PRESEND] = g_signal_new (
 		"presend",
-		G_OBJECT_CLASS_TYPE (class),
+		G_OBJECT_CLASS_TYPE (klass),
 		G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (EMsgComposerClass, presend),
 		msg_composer_accumulator_false_abort,
@@ -2441,7 +2481,7 @@ e_msg_composer_class_init (EMsgComposerClass *class)
 
 	signals[SEND] = g_signal_new (
 		"send",
-		G_OBJECT_CLASS_TYPE (class),
+		G_OBJECT_CLASS_TYPE (klass),
 		G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (EMsgComposerClass, send),
 		NULL, NULL,
@@ -2452,7 +2492,7 @@ e_msg_composer_class_init (EMsgComposerClass *class)
 
 	signals[SAVE_TO_DRAFTS] = g_signal_new (
 		"save-to-drafts",
-		G_OBJECT_CLASS_TYPE (class),
+		G_OBJECT_CLASS_TYPE (klass),
 		G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (EMsgComposerClass, save_to_drafts),
 		NULL, NULL,
@@ -2463,7 +2503,7 @@ e_msg_composer_class_init (EMsgComposerClass *class)
 
 	signals[SAVE_TO_OUTBOX] = g_signal_new (
 		"save-to-outbox",
-		G_OBJECT_CLASS_TYPE (class),
+		G_OBJECT_CLASS_TYPE (klass),
 		G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (EMsgComposerClass, save_to_outbox),
 		NULL, NULL,
@@ -2474,7 +2514,7 @@ e_msg_composer_class_init (EMsgComposerClass *class)
 
 	signals[PRINT] = g_signal_new (
 		"print",
-		G_OBJECT_CLASS_TYPE (class),
+		G_OBJECT_CLASS_TYPE (klass),
 		G_SIGNAL_RUN_LAST,
 		0, NULL, NULL,
 		e_marshal_VOID__ENUM_OBJECT_OBJECT,
@@ -2511,7 +2551,7 @@ e_msg_composer_new (EShell *shell)
 
 	return g_object_new (
 		E_TYPE_MSG_COMPOSER,
-		"html", e_web_view_gtkhtml_new (), "shell", shell, NULL);
+		"shell", shell, NULL);
 }
 
 EFocusTracker *
@@ -2653,8 +2693,10 @@ handle_multipart_signed (EMsgComposer *composer,
 	CamelSession *session;
 	GtkToggleAction *action = NULL;
 	const gchar *protocol;
+	EEditor *editor;
 
 	session = e_msg_composer_get_session (composer);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
 	content = CAMEL_DATA_WRAPPER (multipart);
 	content_type = camel_data_wrapper_get_mime_type_field (content);
@@ -2737,9 +2779,11 @@ handle_multipart_encrypted (EMsgComposer *composer,
 	CamelCipherValidity *valid;
 	GtkToggleAction *action = NULL;
 	const gchar *protocol;
+	EEditor *editor;
 
 	content_type = camel_mime_part_get_content_type (multipart);
 	protocol = camel_content_type_param (content_type, "protocol");
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
 	if (protocol && g_ascii_strcasecmp (protocol, "application/pgp-encrypted") == 0)
 		action = GTK_TOGGLE_ACTION (ACTION (PGP_ENCRYPT));
@@ -2970,6 +3014,7 @@ handle_multipart (EMsgComposer *composer,
 static void
 set_signature_gui (EMsgComposer *composer)
 {
+	/*FIXME WEBKIT We don't support signatures yet....
 	GtkhtmlEditor *editor;
 	EComposerHeaderTable *table;
 	EMailSignatureComboBox *combo_box;
@@ -2988,10 +3033,11 @@ set_signature_gui (EMsgComposer *composer)
 	if (!g_str_has_prefix (data, "uid:"))
 		return;
 
-	/* The combo box active ID is the signature's ESource UID. */
+	// The combo box active ID is the signature's ESource UID.
 	uid = e_composer_decode_clue_value (data + 4);
 	gtk_combo_box_set_active_id (GTK_COMBO_BOX (combo_box), uid);
 	g_free (uid);
+	*/
 }
 
 static void
@@ -3073,6 +3119,8 @@ e_msg_composer_new_with_message (EShell *shell,
 	EComposerHeaderTable *table;
 	ESourceRegistry *registry;
 	ESource *source = NULL;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GtkToggleAction *action;
 	struct _camel_header_raw *xev;
 	gchar *identity_uid;
@@ -3097,6 +3145,8 @@ e_msg_composer_new_with_message (EShell *shell,
 	session = e_msg_composer_get_session (composer);
 	table = e_msg_composer_get_header_table (composer);
 	registry = e_composer_header_table_get_registry (table);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
 
 	if (postto) {
 		e_composer_header_table_set_post_to_list (table, postto);
@@ -3216,18 +3266,19 @@ e_msg_composer_new_with_message (EShell *shell,
 	if (format != NULL) {
 		gchar **flags;
 
-		while (*format && camel_mime_is_lwsp (*format))
+		while (*format && camel_mime_is_lwsp (*format)) {
 			format++;
+		}
 
 		flags = g_strsplit (format, ", ", 0);
 		for (i = 0; flags[i]; i++) {
-			if (g_ascii_strcasecmp (flags[i], "text/html") == 0)
-				gtkhtml_editor_set_html_mode (
-					GTKHTML_EDITOR (composer), TRUE);
-			else if (g_ascii_strcasecmp (flags[i], "text/plain") == 0)
-				gtkhtml_editor_set_html_mode (
-					GTKHTML_EDITOR (composer), FALSE);
-			else if (g_ascii_strcasecmp (flags[i], "pgp-sign") == 0) {
+			if (g_ascii_strcasecmp (flags[i], "text/html") == 0) {
+				e_editor_widget_set_mode (
+					editor_widget, E_EDITOR_WIDGET_MODE_HTML);
+			} else if (g_ascii_strcasecmp (flags[i], "text/plain") == 0) {
+				e_editor_widget_set_mode (
+					editor_widget, E_EDITOR_WIDGET_MODE_PLAIN_TEXT);
+			} else if (g_ascii_strcasecmp (flags[i], "pgp-sign") == 0) {
 				action = GTK_TOGGLE_ACTION (ACTION (PGP_SIGN));
 				gtk_toggle_action_set_active (action, TRUE);
 			} else if (g_ascii_strcasecmp (flags[i], "pgp-encrypt") == 0) {
@@ -3363,7 +3414,8 @@ e_msg_composer_new_redirect (EShell *shell,
 {
 	EMsgComposer *composer;
 	EComposerHeaderTable *table;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	const gchar *subject;
 
 	g_return_val_if_fail (E_IS_SHELL (shell), NULL);
@@ -3381,8 +3433,9 @@ e_msg_composer_new_redirect (EShell *shell,
 	e_composer_header_table_set_identity_uid (table, identity_uid);
 	e_composer_header_table_set_subject (table, subject);
 
-	web_view = e_msg_composer_get_web_view (composer);
-	e_web_view_gtkhtml_set_editable (web_view, FALSE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), FALSE);
 
 	return composer;
 }
@@ -3431,27 +3484,19 @@ e_msg_composer_get_shell (EMsgComposer *composer)
 }
 
 /**
- * e_msg_composer_get_web_view:
+ * e_msg_composer_get_editor:
  * @composer: an #EMsgComposer
  *
- * Returns the #EWebView widget in @composer.
+ * Returns the #EEditor widget in @composer.
  *
- * Returns: the #EWebView
+ * Returns: the #EEditor
  **/
-EWebViewGtkHTML *
-e_msg_composer_get_web_view (EMsgComposer *composer)
+EEditor *
+e_msg_composer_get_editor (EMsgComposer *composer)
 {
-	GtkHTML *html;
-	GtkhtmlEditor *editor;
-
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
 
-	/* This is a convenience function to avoid
-	 * repeating this awkwardness everywhere */
-	editor = GTKHTML_EDITOR (composer);
-	html = gtkhtml_editor_get_html (editor);
-
-	return E_WEB_VIEW_GTKHTML (html);
+	return e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 }
 
 static void
@@ -3461,7 +3506,8 @@ msg_composer_send_cb (EMsgComposer *composer,
 {
 	CamelMimeMessage *message;
 	EAlertSink *alert_sink;
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GError *error = NULL;
 
 	alert_sink = e_activity_get_alert_sink (context->activity);
@@ -3493,8 +3539,9 @@ msg_composer_send_cb (EMsgComposer *composer,
 	g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
 
 	/* The callback can set editor 'changed' if anything failed. */
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, FALSE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, TRUE);
 
 	g_signal_emit (
 		composer, signals[SEND], 0,
@@ -3556,7 +3603,8 @@ msg_composer_save_to_drafts_cb (EMsgComposer *composer,
 {
 	CamelMimeMessage *message;
 	EAlertSink *alert_sink;
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GError *error = NULL;
 
 	alert_sink = e_activity_get_alert_sink (context->activity);
@@ -3597,8 +3645,9 @@ msg_composer_save_to_drafts_cb (EMsgComposer *composer,
 	g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
 
 	/* The callback can set editor 'changed' if anything failed. */
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, FALSE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, FALSE);
 
 	g_signal_emit (
 		composer, signals[SAVE_TO_DRAFTS],
@@ -3654,7 +3703,8 @@ msg_composer_save_to_outbox_cb (EMsgComposer *composer,
 {
 	CamelMimeMessage *message;
 	EAlertSink *alert_sink;
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GError *error = NULL;
 
 	alert_sink = e_activity_get_alert_sink (context->activity);
@@ -3689,9 +3739,9 @@ msg_composer_save_to_outbox_cb (EMsgComposer *composer,
 
 	async_context_free (context);
 
-	/* XXX This should be elsewhere. */
-	editor = GTKHTML_EDITOR (composer);
-	gtkhtml_editor_set_changed (editor, FALSE);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	e_editor_widget_set_changed (editor_widget, FALSE);
 }
 
 /**
@@ -4179,7 +4229,8 @@ e_msg_composer_set_body (EMsgComposer *composer,
 {
 	EMsgComposerPrivate *priv = composer->priv;
 	EComposerHeaderTable *table;
-	EWebViewGtkHTML *web_view;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	ESourceRegistry *registry;
 	ESource *source;
 	const gchar *identity_uid;
@@ -4187,6 +4238,8 @@ e_msg_composer_set_body (EMsgComposer *composer,
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
 	table = e_msg_composer_get_header_table (composer);
 	registry = e_composer_header_table_get_registry (table);
 
@@ -4200,10 +4253,8 @@ e_msg_composer_set_body (EMsgComposer *composer,
 	set_editor_text (composer, buff, FALSE);
 	g_free (buff);
 
-	gtkhtml_editor_set_html_mode (GTKHTML_EDITOR (composer), FALSE);
-
-	web_view = e_msg_composer_get_web_view (composer);
-	e_web_view_gtkhtml_set_editable (web_view, FALSE);
+	e_editor_widget_set_mode (editor_widget, E_EDITOR_WIDGET_MODE_PLAIN_TEXT);
+	webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), FALSE);
 
 	g_free (priv->mime_body);
 	priv->mime_body = g_strdup (body);
@@ -4561,16 +4612,21 @@ e_msg_composer_get_message (EMsgComposer *composer,
 	GSimpleAsyncResult *simple;
 	GtkAction *action;
 	ComposerFlags flags = 0;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+
 	simple = g_simple_async_result_new (
 		G_OBJECT (composer), callback,
 		user_data, e_msg_composer_get_message);
 
 	g_simple_async_result_set_check_cancellable (simple, cancellable);
 
-	if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer)))
+	if (e_editor_widget_get_mode (editor_widget) == E_EDITOR_WIDGET_MODE_HTML)
 		flags |= COMPOSER_FLAG_HTML_CONTENT;
 
 	action = ACTION (PRIORITIZE_MESSAGE);
@@ -4687,6 +4743,8 @@ e_msg_composer_get_message_draft (EMsgComposer *composer,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data)
 {
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GSimpleAsyncResult *simple;
 	ComposerFlags flags = 0;
 
@@ -4698,7 +4756,9 @@ e_msg_composer_get_message_draft (EMsgComposer *composer,
 
 	g_simple_async_result_set_check_cancellable (simple, cancellable);
 
-	if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer)))
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+	if (e_editor_widget_get_mode (editor_widget) == E_EDITOR_WIDGET_MODE_HTML)
 		flags |= COMPOSER_FLAG_HTML_CONTENT;
 
 	composer_build_message (
@@ -4804,17 +4864,19 @@ e_msg_composer_get_reply_to (EMsgComposer *composer)
 GByteArray *
 e_msg_composer_get_raw_message_text (EMsgComposer *composer)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GByteArray *array;
 	gchar *text;
-	gsize length;
 
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
 
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
+
 	array = g_byte_array_new ();
-	editor = GTKHTML_EDITOR (composer);
-	text = gtkhtml_editor_get_text_plain (editor, &length);
-	g_byte_array_append (array, (guint8 *) text, (guint) length);
+	text = e_editor_widget_get_text_plain (editor_widget);
+	g_byte_array_append (array, (guint8 *) text, strlen (text));
 	g_free (text);
 
 	return array;
@@ -4847,22 +4909,24 @@ e_msg_composer_can_close (EMsgComposer *composer,
                           gboolean can_save_draft)
 {
 	gboolean res = FALSE;
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	EComposerHeaderTable *table;
 	GdkWindow *window;
 	GtkWidget *widget;
 	const gchar *subject;
 	gint response;
 
-	editor = GTKHTML_EDITOR (composer);
 	widget = GTK_WIDGET (composer);
+	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
 
 	/* this means that there is an async operation running,
 	 * in which case the composer cannot be closed */
 	if (!gtk_action_group_get_sensitive (composer->priv->async_actions))
 		return FALSE;
 
-	if (!gtkhtml_editor_get_changed (editor))
+	if (!e_editor_widget_get_changed (editor_widget))
 		return TRUE;
 
 	window = gtk_widget_get_window (widget);
@@ -4901,6 +4965,8 @@ e_msg_composer_can_close (EMsgComposer *composer,
 void
 e_msg_composer_reply_indent (EMsgComposer *composer)
 {
+	/* FIXME WEBKIT We already have indentation implementation. Why
+	 * is this done? 
 	GtkhtmlEditor *editor;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
@@ -4922,6 +4988,7 @@ e_msg_composer_reply_indent (EMsgComposer *composer)
 	gtkhtml_editor_run_command (editor, "indent-zero");
 	gtkhtml_editor_run_command (editor, "text-default-color");
 	gtkhtml_editor_run_command (editor, "italic-off");
+	*/
 }
 
 EComposerHeaderTable *
@@ -4941,10 +5008,10 @@ e_msg_composer_get_attachment_view (EMsgComposer *composer)
 }
 
 GList *
-e_load_spell_languages (void)
+e_load_spell_languages (ESpellChecker *spell_checker)
 {
 	GSettings *settings;
-	GList *spell_languages = NULL;
+	GList *spell_dicts = NULL;
 	gchar **strv;
 	gint ii;
 
@@ -4956,50 +5023,49 @@ e_load_spell_languages (void)
 	/* Convert the codes to spell language structs. */
 	for (ii = 0; strv[ii] != NULL; ii++) {
 		gchar *language_code = strv[ii];
-		const GtkhtmlSpellLanguage *language;
+		ESpellDictionary *dict;
 
-		language = gtkhtml_spell_language_lookup (language_code);
-		if (language != NULL)
-			spell_languages = g_list_prepend (
-				spell_languages, (gpointer) language);
+		dict = e_spell_checker_lookup_dictionary (spell_checker, language_code);
+		if (dict != NULL)
+			spell_dicts = g_list_prepend (
+				spell_dicts, (gpointer) dict);
 	}
 
 	g_strfreev (strv);
 
-	spell_languages = g_list_reverse (spell_languages);
+	spell_dicts = g_list_reverse (spell_dicts);
 
 	/* Pick a default spell language if it came back empty. */
-	if (spell_languages == NULL) {
-		const GtkhtmlSpellLanguage *language;
+	if (spell_dicts == NULL) {
+		ESpellDictionary *dict;
 
-		language = gtkhtml_spell_language_lookup (NULL);
+		dict = e_spell_checker_lookup_dictionary (spell_checker, NULL);
 
-		if (language) {
-			spell_languages = g_list_prepend (
-				spell_languages, (gpointer) language);
+		if (dict) {
+			spell_dicts = g_list_prepend (
+				spell_dicts, (gpointer) dict);
 		}
 	}
 
-	return spell_languages;
+	return spell_dicts;
 }
 
 void
-e_save_spell_languages (GList *spell_languages)
+e_save_spell_languages (const GList *spell_dicts)
 {
 	GSettings *settings;
 	GPtrArray *lang_array;
 
 	/* Build a list of spell check language codes. */
 	lang_array = g_ptr_array_new ();
-	while (spell_languages != NULL) {
-		const GtkhtmlSpellLanguage *language;
+	while (spell_dicts != NULL) {
+		ESpellDictionary *dict = spell_dicts->data;
 		const gchar *language_code;
 
-		language = spell_languages->data;
-		language_code = gtkhtml_spell_language_get_code (language);
+		language_code = e_spell_dictionary_get_code (dict);
 		g_ptr_array_add (lang_array, (gpointer) language_code);
 
-		spell_languages = g_list_next (spell_languages);
+		spell_dicts = g_list_next (spell_dicts);
 	}
 
 	g_ptr_array_add (lang_array, NULL);
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index a85993f..4dd6c7c 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -24,13 +24,13 @@
 #ifndef E_MSG_COMPOSER_H
 #define E_MSG_COMPOSER_H
 
+#include <widgets/editor/e-editor-window.h>
+#include <widgets/editor/e-editor-actions.h>
 #include <camel/camel.h>
-#include <gtkhtml-editor.h>
 #include <libebook/libebook.h>
 
 #include <misc/e-attachment-view.h>
 #include <misc/e-focus-tracker.h>
-#include <misc/e-web-view-gtkhtml.h>
 #include <shell/e-shell.h>
 
 #include <composer/e-composer-header-table.h>
@@ -61,12 +61,12 @@ typedef struct _EMsgComposerClass EMsgComposerClass;
 typedef struct _EMsgComposerPrivate EMsgComposerPrivate;
 
 struct _EMsgComposer {
-	GtkhtmlEditor parent;
+	EEditorWindow parent;
 	EMsgComposerPrivate *priv;
 };
 
 struct _EMsgComposerClass {
-	GtkhtmlEditorClass parent_class;
+	EEditorWindowClass parent_class;
 
 	/* Signals */
 	gboolean	(*presend)		(EMsgComposer *composer);
@@ -100,8 +100,8 @@ EFocusTracker *	e_msg_composer_get_focus_tracker
 						(EMsgComposer *composer);
 CamelSession *	e_msg_composer_get_session	(EMsgComposer *composer);
 EShell *	e_msg_composer_get_shell	(EMsgComposer *composer);
-EWebViewGtkHTML *
-		e_msg_composer_get_web_view	(EMsgComposer *composer);
+EEditor *
+		e_msg_composer_get_editor	(EMsgComposer *composer);
 
 void		e_msg_composer_send		(EMsgComposer *composer);
 void		e_msg_composer_save_to_drafts	(EMsgComposer *composer);
@@ -201,8 +201,8 @@ GByteArray *	e_msg_composer_get_raw_message_text
 
 gboolean	e_msg_composer_is_exiting	(EMsgComposer *composer);
 
-GList *		e_load_spell_languages		(void);
-void		e_save_spell_languages		(GList *spell_languages);
+GList *		e_load_spell_languages		(ESpellChecker *spell_checker);
+void		e_save_spell_languages		(const GList *spell_languages);
 
 G_END_DECLS
 
diff --git a/configure.ac b/configure.ac
index 51175f0..2fd2979 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,6 @@ m4_define([glib_minimum_version], [2.32.0])
 m4_define([gtk_minimum_version], [3.4.0])
 m4_define([eds_minimum_version], [evo_version])
 m4_define([enchant_minimum_version], [1.1.7])
-m4_define([gtkhtml_minimum_version], [4.5.2])
 m4_define([gnome_desktop_minimum_version], [2.91.3])
 m4_define([gnome_icon_theme_minimum_version], [2.30.2.1])
 m4_define([gsettings_desktop_schemas_minimum_version], [2.91.92])
@@ -707,16 +706,6 @@ AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
 			[AC_MSG_ERROR([No regex library found])])])
 AC_SUBST(REGEX_LIBS)
 
-dnl *************************
-dnl GTKHTML check
-dnl XXX Drop the version from the package name?
-dnl *************************
-PKG_CHECK_MODULES([GTKHTML],
-	[libgtkhtml-4.0 >= gtkhtml_minimum_version
-	 gtkhtml-editor-4.0])
-AC_SUBST(GTKHTML_CFLAGS)
-AC_SUBST(GTKHTML_LIBS)
-
 dnl ************
 dnl Kerberos 5
 dnl ************
diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am
index 51ac212..c5e5926 100644
--- a/widgets/misc/Makefile.am
+++ b/widgets/misc/Makefile.am
@@ -237,8 +237,7 @@ test_dateedit_LDADD = 				\
 # test-mail-signatures
 
 test_mail_signatures_CPPFLAGS =			\
-	$(test_widgets_misc_CPPFLAGS)		\
-	$(GTKHTML_CFLAGS)
+	$(test_widgets_misc_CPPFLAGS)
 
 test_mail_signatures_SOURCES = test-mail-signatures.c
 



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