aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-composer-private.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-17 02:34:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-01-18 01:11:08 +0800
commit3e7c7808cc65c22bc40a7d1d30ffa0044097a6ff (patch)
treed74cd0017e310c79b796eba3df7bfb8947a673d7 /composer/e-composer-private.c
parent2cf0c27e2ece428dd2af1945f6fececbe9dbcc15 (diff)
downloadgsoc2013-evolution-3e7c7808cc65c22bc40a7d1d30ffa0044097a6ff.tar.gz
gsoc2013-evolution-3e7c7808cc65c22bc40a7d1d30ffa0044097a6ff.tar.zst
gsoc2013-evolution-3e7c7808cc65c22bc40a7d1d30ffa0044097a6ff.zip
Improve clipboard behavior.
Add "copy-target-list" and "paste-target-list" to the ESelectable interface. These are underutilized for the moment, but will eventually be used to help integrate drag-and-drop support into ESelectable. Add cut and paste support to EWebView, along with a new "editable" property and new clipboard signals "copy-clipboard", "cut-clipboard" and "paste-clipboard". In EFocusTracker, listen for "owner-changed" signals from the default clipboard as another trigger to update actions, particularly the Paste action. (Unfortunately this doesn't work for EWebView since GtkHtml implements its own clipboard.) In EMsgComposer, convert GtkhtmlEditor's clipboard methods to empty stubs, since EFocusTracker will now trigger EWebView's clipboard actions. Also, intercept EWebView::paste-clipboard signals and improve the interaction between the HTML editor and the attachment bar based on use cases in bug #603715.
Diffstat (limited to 'composer/e-composer-private.c')
-rw-r--r--composer/e-composer-private.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index b0bc0c999d..0f7ffbb64c 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -509,6 +509,27 @@ e_composer_get_default_charset (void)
}
gboolean
+e_composer_paste_html (EMsgComposer *composer,
+ GtkClipboard *clipboard)
+{
+ GtkhtmlEditor *editor;
+ gchar *html;
+
+ g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
+ g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), FALSE);
+
+ 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);
+
+ g_free (html);
+
+ return TRUE;
+}
+
+gboolean
e_composer_paste_image (EMsgComposer *composer,
GtkClipboard *clipboard)
{
@@ -583,6 +604,27 @@ exit:
}
gboolean
+e_composer_paste_text (EMsgComposer *composer,
+ GtkClipboard *clipboard)
+{
+ GtkhtmlEditor *editor;
+ gchar *text;
+
+ g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), FALSE);
+ g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), FALSE);
+
+ 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);
+
+ g_free (text);
+
+ return TRUE;
+}
+
+gboolean
e_composer_paste_uris (EMsgComposer *composer,
GtkClipboard *clipboard)
{