The Battle for Wesnoth  1.19.24+dev
Namespaces | Functions
windows_tray_notification Namespace Reference

Namespaces

 implementation
 

Functions

bool show (std::string title, std::string message)
 Displays a tray notification. More...
 
bool message_hook (const MSG &msg)
 Frees resources when a notification disappears, switches user to the wesnoth window if the notification popup was clicked by user. More...
 

Function Documentation

◆ message_hook()

bool windows_tray_notification::message_hook ( const MSG msg)

Frees resources when a notification disappears, switches user to the wesnoth window if the notification popup was clicked by user.

Parameters
msgWindows message payload.
Returns
True if the message was handled.

Definition at line 225 of file windows_tray_notification.cpp.

References windows_tray_notification::implementation::destroy_tray_icon(), windows_tray_notification::implementation::message_reset, wfl::msg(), and windows_tray_notification::implementation::switch_to_wesnoth_window().

◆ show()

bool windows_tray_notification::show ( std::string  title,
std::string  message 
)

Displays a tray notification.

When user clicks on the notification popup, the user switches to the wesnoth window.

Parameters
titleTitle of a notification. Gets truncated if longer than 64 characters, including the terminating null character.
messageMessage of a notification. Gets truncated if longer than 256 characters, including the terminating null character.
Returns
True if message was shown successfully, False otherwise.

Definition at line 198 of file windows_tray_notification.cpp.

References windows_tray_notification::implementation::adjust_length(), windows_tray_notification::implementation::create_tray_icon(), windows_tray_notification::implementation::destroy_tray_icon(), windows_tray_notification::implementation::nid, and windows_tray_notification::implementation::set_tray_message().

Referenced by actions::place_recruit(), unit_creator::post_create(), actions::recall_unit(), actions::recruit_unit(), gui2::policy::minimum_selection::one_item::set_item_shown(), gui2::policy::minimum_selection::no_item::set_item_shown(), gui2::generator< minimum_selection, maximum_selection, my_placement, select_action >::set_item_shown(), prefs::set_lobby_joins(), and SYNCED_COMMAND_HANDLER_FUNCTION().