NetSurf
|
Automated RISC OS message routing (implementation). More...
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include "oslib/os.h"
#include "oslib/wimp.h"
#include "utils/log.h"
#include "riscos/message.h"
#include "riscos/gui.h"
Go to the source code of this file.
Data Structures | |
struct | active_message |
Functions | |
static struct active_message * | ro_message_add (unsigned int message_code, void(*callback)(wimp_message *message)) |
static void | ro_message_free (int ref) |
bool | ro_message_send_message (wimp_event_no event, wimp_message *message, wimp_t task, void(*callback)(wimp_message *message)) |
Sends a message and registers a return route for a bounce. More... | |
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) |
Sends a message and registers a return route for a bounce. More... | |
bool | ro_message_register_handler (wimp_message *message, unsigned int message_code, void(*callback)(wimp_message *message)) |
Registers a return route for a message. More... | |
bool | ro_message_register_route (unsigned int message_code, void(*callback)(wimp_message *message)) |
Registers a route for a message code. More... | |
bool | ro_message_handle_message (wimp_event_no event, wimp_message *message) |
Attempts to route a message. More... | |
Variables | |
struct active_message * | current_messages = NULL |
Automated RISC OS message routing (implementation).
Definition in file message.c.
|
static |
Definition at line 165 of file message.c.
References active_message::callback, current_messages, active_message::id, active_message::message_code, active_message::next, and active_message::previous.
Referenced by ro_message_register_handler(), and ro_message_register_route().
|
static |
Definition at line 234 of file message.c.
References current_messages, active_message::id, active_message::next, and active_message::previous.
Referenced by ro_message_handle_message().
bool ro_message_handle_message | ( | wimp_event_no | event, |
wimp_message * | message | ||
) |
Attempts to route a message.
event | wimp event |
message | the message to attempt to route |
Definition at line 192 of file message.c.
References active_message::callback, current_messages, active_message::id, active_message::message_code, active_message::next, and ro_message_free().
Referenced by ro_gui_user_message().
bool ro_message_register_handler | ( | wimp_message * | message, |
unsigned int | message_code, | ||
void(*)(wimp_message *message) | callback | ||
) |
Registers a return route for a message.
This function must be called after wimp_send_message so that a valid value is present in the my_ref field.
message | the message to register a route back for |
message_code | the message action code to route |
callback | the code to call for a matched action |
Definition at line 134 of file message.c.
References active_message::callback, active_message::id, active_message::message_code, and ro_message_add().
Referenced by ro_message_send_message(), and ro_message_send_message_to_window().
bool ro_message_register_route | ( | unsigned int | message_code, |
void(*)(wimp_message *message) | callback | ||
) |
Registers a route for a message code.
message_code | the message action code to route |
callback | the code to call for a matched action |
Definition at line 157 of file message.c.
References active_message::callback, active_message::message_code, and ro_message_add().
Referenced by gui_init().
bool ro_message_send_message | ( | wimp_event_no | event, |
wimp_message * | message, | ||
wimp_t | task, | ||
void(*)(wimp_message *message) | callback | ||
) |
Sends a message and registers a return route for a bounce.
event | the message event type |
message | the message to register a route back for |
task | the task to send a message to, or 0 for broadcast |
callback | the code to call on a bounce |
Definition at line 57 of file message.c.
References active_message::callback, NSLOG, ro_message_register_handler(), and ro_warn_user().
Referenced by ro_gui_hotlist_add_page(), ro_gui_selection_prepare_paste(), ro_gui_selection_prepare_paste_dataload(), ro_gui_selection_prepare_paste_datasave(), ro_gui_selection_send_dragging(), ro_gui_send_datasave(), and ro_gui_view_source().
bool ro_message_send_message_to_window | ( | wimp_event_no | event, |
wimp_message * | message, | ||
wimp_w | to_w, | ||
wimp_i | to_i, | ||
void(*)(wimp_message *message) | callback, | ||
wimp_t * | to_t | ||
) |
Sends a message and registers a return route for a bounce.
event | the message event type |
message | the message to register a route back for |
to_w | the window to send the message to |
to_i | the icon |
callback | the code to call on a bounce |
to_t | receives the task handle of the window's creator |
Definition at line 94 of file message.c.
References active_message::callback, NSLOG, ro_message_register_handler(), and ro_warn_user().
Referenced by ro_gui_save_drag_end(), and ro_gui_selection_send_dragging().
struct active_message* current_messages = NULL |
Definition at line 41 of file message.c.
Referenced by ro_message_add(), ro_message_free(), and ro_message_handle_message().