GUI2/Dispatcher: pass the message parameter for message events around as const
Really no reason for it to be non-const. That would imply the message's contents should be modifiable, but that doesn't make sense.
This commit is contained in:
parent
b47b6f1359
commit
300197e9c0
4 changed files with 11 additions and 12 deletions
|
@ -124,8 +124,7 @@ bool dispatcher::fire(const ui_event event, widget& target, void*)
|
|||
return fire_event<signal_notification_function>(event, this, &target, nullptr);
|
||||
}
|
||||
|
||||
// TODO: is there any reason msg isn't a const reference?
|
||||
bool dispatcher::fire(const ui_event event, widget& target, message& msg)
|
||||
bool dispatcher::fire(const ui_event event, widget& target, const message& msg)
|
||||
{
|
||||
assert(is_message_event(event));
|
||||
return fire_event<signal_message_function>(event, this, &target, msg);
|
||||
|
|
|
@ -239,7 +239,7 @@ using signal_notification_function = dispatcher_callback_func<void*>;
|
|||
* Extra parameters:
|
||||
* 5. The applicable data this event requires.
|
||||
*/
|
||||
using signal_message_function = dispatcher_callback_func<message&>;
|
||||
using signal_message_function = dispatcher_callback_func<const message&>;
|
||||
|
||||
/**
|
||||
* Raw event callback function signature.
|
||||
|
@ -389,7 +389,7 @@ public:
|
|||
*/
|
||||
bool fire(const ui_event event,
|
||||
widget& target,
|
||||
message& msg);
|
||||
const message& msg);
|
||||
|
||||
/**
|
||||
* Fires an event that's a raw SDL event
|
||||
|
|
|
@ -1198,12 +1198,12 @@ void window::signal_handler_sdl_key_down(const event::ui_event event,
|
|||
|
||||
void window::signal_handler_message_show_tooltip(const event::ui_event event,
|
||||
bool& handled,
|
||||
event::message& message)
|
||||
const event::message& message)
|
||||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".\n";
|
||||
|
||||
event::message_show_tooltip& request
|
||||
= dynamic_cast<event::message_show_tooltip&>(message);
|
||||
const event::message_show_tooltip& request
|
||||
= dynamic_cast<const event::message_show_tooltip&>(message);
|
||||
|
||||
dialogs::tip::show(tooltip_.id, request.message, request.location, request.source_rect);
|
||||
|
||||
|
@ -1212,12 +1212,12 @@ void window::signal_handler_message_show_tooltip(const event::ui_event event,
|
|||
|
||||
void window::signal_handler_message_show_helptip(const event::ui_event event,
|
||||
bool& handled,
|
||||
event::message& message)
|
||||
const event::message& message)
|
||||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".\n";
|
||||
|
||||
event::message_show_helptip& request
|
||||
= dynamic_cast<event::message_show_helptip&>(message);
|
||||
const event::message_show_helptip& request
|
||||
= dynamic_cast<const event::message_show_helptip&>(message);
|
||||
|
||||
dialogs::tip::show(helptip_.id, request.message, request.location, request.source_rect);
|
||||
|
||||
|
|
|
@ -720,11 +720,11 @@ private:
|
|||
|
||||
void signal_handler_message_show_tooltip(const event::ui_event event,
|
||||
bool& handled,
|
||||
event::message& message);
|
||||
const event::message& message);
|
||||
|
||||
void signal_handler_message_show_helptip(const event::ui_event event,
|
||||
bool& handled,
|
||||
event::message& message);
|
||||
const event::message& message);
|
||||
|
||||
void signal_handler_request_placement(const event::ui_event event,
|
||||
bool& handled);
|
||||
|
|
Loading…
Add table
Reference in a new issue