#include #include GAction::GAction(const String& text, const String& custom_data, Function on_activation_callback) : on_activation(move(on_activation_callback)) , m_text(text) , m_custom_data(custom_data) { } GAction::GAction(const String& text, Function on_activation_callback) : GAction(text, String(), move(on_activation_callback)) { } GAction::GAction(const String& text, RetainPtr&& icon, Function on_activation_callback) : on_activation(move(on_activation_callback)) , m_text(text) , m_icon(move(icon)) { } GAction::GAction(const String& text, const GShortcut& shortcut, Function on_activation_callback) : GAction(text, shortcut, nullptr, move(on_activation_callback)) { } GAction::GAction(const String& text, const GShortcut& shortcut, RetainPtr&& icon, Function on_activation_callback) : on_activation(move(on_activation_callback)) , m_text(text) , m_icon(move(icon)) , m_shortcut(shortcut) { GApplication::the().register_shortcut_action(Badge(), *this); } GAction::~GAction() { if (m_shortcut.is_valid()) GApplication::the().unregister_shortcut_action(Badge(), *this); } void GAction::activate() { if (on_activation) on_activation(*this); }