#pragma once #include #include #include #include class GAction; class Point; class GMenu { public: explicit GMenu(const StringView& name = ""); ~GMenu(); static GMenu* from_menu_id(int); const String& name() const { return m_name; } GAction* action_at(int); void add_action(NonnullRefPtr); void add_separator(); void add_submenu(NonnullOwnPtr); void popup(const Point& screen_position); void dismiss(); Function on_item_activation; private: friend class GMenuBar; int menu_id() const { return m_menu_id; } int realize_menu(); void unrealize_menu(); void realize_if_needed(); int m_menu_id { -1 }; String m_name; NonnullOwnPtrVector m_items; };