summaryrefslogtreecommitdiff
path: root/riscos/message.c
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2006-02-15 23:09:55 +0000
committerAdrian Lees <adrian@aemulor.com>2006-02-15 23:09:55 +0000
commitdbfdafdf1820a95995c3b260e147c55125468874 (patch)
tree8ef69f8cbc4733490f82b462edeb167c0ee08fb8 /riscos/message.c
parent07d55db910095415d15cc2b6509fd44efa79a875 (diff)
downloadnetsurf-dbfdafdf1820a95995c3b260e147c55125468874.tar.gz
netsurf-dbfdafdf1820a95995c3b260e147c55125468874.tar.bz2
[project @ 2006-02-15 23:09:53 by adrianl]
Extend text selection, copying, saving and searching code to handle textplain contents; modified textplain code to accept other line terminators svn path=/import/netsurf/; revision=2081
Diffstat (limited to 'riscos/message.c')
-rw-r--r--riscos/message.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/riscos/message.c b/riscos/message.c
index 20ad8f37f..40a465e61 100644
--- a/riscos/message.c
+++ b/riscos/message.c
@@ -68,6 +68,43 @@ bool ro_message_send_message(wimp_event_no event, wimp_message *message,
/**
+ * Sends a message and registers a return route for a bounce.
+ *
+ * \param event the message event type
+ * \param message the message to register a route back for
+ * \param to_w the window to send the message to
+ * \param to_i the icon
+ * \param callback the code to call on a bounce
+ * \param to_t receives the task handle of the window's creator
+ * \return true on success, false otherwise
+ */
+bool ro_message_send_message_to_window(wimp_event_no event, wimp_message *message,
+ wimp_w to_w, wimp_i to_i, void (*callback)(wimp_message *message),
+ wimp_t *to_t) {
+ os_error *error;
+
+ assert(message);
+
+ /* send a message */
+ error = xwimp_send_message_to_window(event, message, to_w, to_i, to_t);
+ if (error) {
+ LOG(("xwimp_send_message_to_window: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("WimpError", error->errmess);
+ return false;
+ }
+
+ /* register the default bounce handler */
+ if (callback) {
+ assert(event == wimp_USER_MESSAGE_RECORDED);
+ return ro_message_register_handler(message, message->action,
+ callback);
+ }
+ return true;
+}
+
+
+/**
* Registers a return route for a message.
*
* This function must be called after wimp_send_message so that a