From dbfdafdf1820a95995c3b260e147c55125468874 Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Wed, 15 Feb 2006 23:09:55 +0000 Subject: [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 --- riscos/message.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'riscos/message.c') diff --git a/riscos/message.c b/riscos/message.c index 20ad8f37f..40a465e61 100644 --- a/riscos/message.c +++ b/riscos/message.c @@ -67,6 +67,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. * -- cgit v1.2.3