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



commit c0567cd6dbf9013d592e77a75d869afa1ba12415
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                  |    6 +-
 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-msg-composer.c             |  347 +++--
 composer/e-msg-composer.h             |   13 +-
 configure.ac                          |   11 -
 doc/reference/libeutil/libeutil.types |    1 -
 e-util/Makefile.am                    |    2 -
 e-util/e-util.h                       |    1 -
 e-util/e-web-view-gtkhtml.c           | 2317 ---------------------------------
 e-util/e-web-view-gtkhtml.h           |  210 ---
 13 files changed, 395 insertions(+), 2834 deletions(-)
---
diff --git a/composer/Makefile.am b/composer/Makefile.am
index 8c9425a..ccb9b5b 100644
--- a/composer/Makefile.am
+++ b/composer/Makefile.am
@@ -35,8 +35,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,8 +60,7 @@ libcomposer_la_LIBADD =					\
 	$(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la		\
 	$(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.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 1317775..55f859c 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -80,20 +80,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
@@ -148,12 +152,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;
@@ -183,7 +189,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,
@@ -192,13 +198,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;
@@ -222,8 +230,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));
@@ -264,20 +273,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[] = {
@@ -460,15 +473,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;
@@ -512,23 +525,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 514a485..0ab151d 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);
 
@@ -299,15 +309,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;
@@ -383,13 +394,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;
@@ -410,7 +414,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. */
 
@@ -462,10 +468,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
@@ -700,7 +707,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);
@@ -709,8 +718,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);
 
@@ -721,7 +732,8 @@ gboolean
 e_composer_paste_image (EMsgComposer *composer,
                         GtkClipboard *clipboard)
 {
-	GtkhtmlEditor *editor;
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	EAttachmentStore *store;
 	EAttachmentView *view;
 	GdkPixbuf *pixbuf = NULL;
@@ -733,7 +745,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);
 
@@ -763,9 +774,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);
@@ -795,7 +811,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);
@@ -804,8 +822,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);
 
@@ -953,6 +973,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;
@@ -966,15 +987,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;
@@ -982,11 +1003,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')
@@ -1008,10 +1029,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;
@@ -1024,11 +1044,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);
 	}
@@ -1047,12 +1067,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);
@@ -1084,7 +1104,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");
 	}
@@ -1097,30 +1117,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-msg-composer.c b/composer/e-msg-composer.c
index 8d0252c..2ec663e 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 "e-composer-private.h"
 
@@ -43,6 +44,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;
@@ -129,7 +132,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))
@@ -1065,7 +1068,6 @@ composer_build_message (EMsgComposer *composer,
 	EMsgComposerPrivate *priv;
 	GSimpleAsyncResult *simple;
 	AsyncContext *context;
-	GtkhtmlEditor *editor;
 	EAttachmentView *view;
 	EAttachmentStore *store;
 	EComposerHeaderTable *table;
@@ -1088,7 +1090,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);
@@ -1220,11 +1221,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");
@@ -1287,20 +1291,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);
@@ -1476,6 +1489,7 @@ use_top_signature (EMsgComposer *composer)
 		shell_settings, "composer-top-signature");
 }
 
+/* FIXME WEBKIT Nope....*/
 #define NO_SIGNATURE_TEXT	\
 	"<!--+GtkHTML:<DATA class=\"ClueFlow\" " \
 	"                     key=\"signature\" " \
@@ -1490,6 +1504,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);
@@ -1518,7 +1534,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);
@@ -1531,12 +1549,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
@@ -1563,6 +1583,7 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
 	ESourceMailComposition *mc;
 	ESourceOpenPGP *pgp;
 	ESourceSMIME *smime;
+	EEditor *editor;
 	EComposerHeaderTable *table;
 	GtkToggleAction *action;
 	ESource *source;
@@ -1573,6 +1594,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);
@@ -1622,11 +1644,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. */
@@ -1637,7 +1661,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;
@@ -1656,7 +1680,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;
@@ -1670,6 +1694,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)
@@ -1686,8 +1711,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);
 
@@ -1729,9 +1756,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. */
@@ -1762,20 +1796,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. */
@@ -1803,6 +1841,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);
@@ -1929,18 +1971,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);
@@ -1953,8 +1994,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);
 
@@ -1996,21 +2038,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 (
@@ -2059,7 +2101,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);
@@ -2101,6 +2143,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. */
@@ -2129,7 +2173,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
@@ -2138,12 +2184,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 (
@@ -2163,12 +2209,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;
 	}
@@ -2179,33 +2225,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;
 
@@ -2229,12 +2278,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;
 
@@ -2257,7 +2308,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");
 
@@ -2270,19 +2321,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);
 
@@ -2308,9 +2357,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))
@@ -2330,6 +2381,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
@@ -2383,37 +2435,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,
@@ -2438,7 +2478,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,
@@ -2448,7 +2488,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,
@@ -2459,7 +2499,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,
@@ -2470,7 +2510,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,
@@ -2481,7 +2521,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,
@@ -2518,7 +2558,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 *
@@ -2660,8 +2700,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);
@@ -2744,9 +2786,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));
@@ -2977,6 +3021,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;
@@ -2995,10 +3040,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
@@ -3077,6 +3123,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;
@@ -3101,6 +3149,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);
@@ -3233,11 +3283,11 @@ e_msg_composer_new_with_message (EShell *shell,
 		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);
+				e_editor_widget_set_mode (
+					editor_widget, E_EDITOR_WIDGET_MODE_HTML);
 			} else if (g_ascii_strcasecmp (flags[i], "text/plain") == 0) {
-				gtkhtml_editor_set_html_mode (
-					GTKHTML_EDITOR (composer), FALSE);
+				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);
@@ -3376,7 +3426,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);
@@ -3394,8 +3445,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;
 }
@@ -3444,27 +3496,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
@@ -3474,7 +3518,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);
@@ -3506,8 +3551,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,
@@ -3569,7 +3615,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);
@@ -3610,8 +3657,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],
@@ -3669,7 +3717,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);
@@ -3704,9 +3753,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);
 }
 
 /**
@@ -4196,7 +4245,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;
@@ -4204,6 +4254,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);
 
@@ -4217,10 +4269,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);
@@ -4576,16 +4626,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);
@@ -4702,6 +4757,8 @@ e_msg_composer_get_message_draft (EMsgComposer *composer,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data)
 {
+	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GSimpleAsyncResult *simple;
 	ComposerFlags flags = 0;
 
@@ -4713,7 +4770,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 (
@@ -4819,17 +4878,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;
@@ -4862,22 +4923,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);
@@ -4916,6 +4979,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));
@@ -4937,6 +5002,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 *
@@ -4956,10 +5022,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;
 
@@ -4971,50 +5037,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 941845a..0e1aa96 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -25,7 +25,6 @@
 #define E_MSG_COMPOSER_H
 
 #include <camel/camel.h>
-#include <gtkhtml-editor.h>
 #include <libebook/libebook.h>
 
 #include <shell/e-shell.h>
@@ -58,12 +57,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);
@@ -97,8 +96,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);
@@ -198,8 +197,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 f54263c..dbcb292 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,6 @@ m4_define([soup_encoded_version], [SOUP_VERSION_2_40])
 
 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])
@@ -749,16 +748,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/doc/reference/libeutil/libeutil.types b/doc/reference/libeutil/libeutil.types
index 83e2108..ca97ade 100644
--- a/doc/reference/libeutil/libeutil.types
+++ b/doc/reference/libeutil/libeutil.types
@@ -157,7 +157,6 @@ e_tree_table_adapter_get_type
 e_ui_manager_get_type
 e_url_entry_get_type
 e_web_view_get_type
-e_web_view_gtkhtml_get_type
 e_web_view_preview_get_type
 gal_define_views_dialog_get_type
 gal_define_views_model_get_type
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 52e19b0..3e66e43 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -326,7 +326,6 @@ eutilinclude_HEADERS =  \
 	e-url-entry.h \
 	e-util-enums.h \
 	e-util-enumtypes.h \
-	e-web-view-gtkhtml.h \
 	e-web-view-preview.h \
 	e-web-view.h \
 	e-xml-utils.h \
@@ -597,7 +596,6 @@ libeutil_la_SOURCES = \
 	e-url-entry.c \
 	e-util-enumtypes.c \
 	e-util-private.h \
-	e-web-view-gtkhtml.c \
 	e-web-view-preview.c \
 	e-web-view.c \
 	e-xml-utils.c \
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 05a3a6a..74194cd8 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -241,7 +241,6 @@
 #include <e-util/e-unicode.h>
 #include <e-util/e-url-entry.h>
 #include <e-util/e-util-enums.h>
-#include <e-util/e-web-view-gtkhtml.h>
 #include <e-util/e-web-view-preview.h>
 #include <e-util/e-web-view.h>
 #include <e-util/e-xml-utils.h>



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