summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-08-18 22:19:15 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-08-18 22:19:15 +0100
commita2906b39943dc078654f2f1dc5d122221d826d9a (patch)
tree38a5197946bbd5f2526231cf2c818c9311a69021
parent19d2a0c01185451d2e2903f116f792e591b8ff5f (diff)
downloadnetsurf-a2906b39943dc078654f2f1dc5d122221d826d9a.tar.gz
netsurf-a2906b39943dc078654f2f1dc5d122221d826d9a.tar.bz2
Add paste request content message.
-rw-r--r--content/content.h11
-rw-r--r--desktop/browser.c6
-rw-r--r--render/html.c5
3 files changed, 21 insertions, 1 deletions
diff --git a/content/content.h b/content/content.h
index d0b525c85..19ec7919a 100644
--- a/content/content.h
+++ b/content/content.h
@@ -77,7 +77,8 @@ typedef enum {
CONTENT_MSG_SCROLL, /**< Request to scroll content */
CONTENT_MSG_DRAGSAVE, /**< Allow drag saving of content */
CONTENT_MSG_SAVELINK, /**< Allow URL to be saved */
- CONTENT_MSG_POINTER /**< Wants a specific mouse pointer set */
+ CONTENT_MSG_POINTER, /**< Wants a specific mouse pointer set */
+ CONTENT_MSG_PASTE /**< Inform that content wants clipboard paste */
} content_msg;
/** RFC5988 metadata link */
@@ -148,6 +149,14 @@ union content_msg_data {
} savelink;
/** CONTENT_MSG_POINTER - Mouse pointer to set */
browser_pointer_shape pointer;
+ /** CONTENT_MSG_PASTE - Content requests that clipboard is pasted */
+ struct {
+ /* TODO: Get rid of these coords.
+ * browser_window_paste_text doesn't take coords, but
+ * RISC OS front end is doing something different. */
+ int x;
+ int y;
+ } paste;
};
/** parameters to content redraw */
diff --git a/desktop/browser.c b/desktop/browser.c
index f9519b011..64b35bb67 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1488,6 +1488,12 @@ nserror browser_window_callback(hlcache_handle *c,
browser_window_set_pointer(bw, event->data.pointer);
break;
+ case CONTENT_MSG_PASTE:
+ /* Content wants a clipboard paste */
+ gui_paste_from_clipboard(bw->window,
+ event->data.paste.x, event->data.paste.y);
+ break;
+
default:
assert(0);
}
diff --git a/render/html.c b/render/html.c
index ed7e7ebaa..1b49b84f0 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1257,6 +1257,11 @@ html_object_callback(hlcache_handle *object,
content_broadcast(&c->base, CONTENT_MSG_POINTER, event->data);
break;
+ case CONTENT_MSG_PASTE:
+ /* Pass it on */
+ content_broadcast(&c->base, CONTENT_MSG_PASTE, event->data);
+ break;
+
default:
assert(0);
}