#pragma once #include "WSMenu.h" #include #include #include #include class AClientConnection; class WSMenuManager final : public CObject { C_OBJECT(WSMenuManager) public: WSMenuManager(); virtual ~WSMenuManager() override; void setup(); void refresh(); virtual void event(CEvent&) override; bool is_open(const WSMenu&) const; Vector>& open_menu_stack() { return m_open_menu_stack; } void set_needs_window_resize(); WSMenu* current_menu() { return m_current_menu.ptr(); } void set_current_menu(WSMenu*, bool is_submenu = false); void close_bar(); void close_everyone(); void close_everyone_not_in_lineage(WSMenu&); void close_menu_and_descendants(WSMenu&); private: void close_menus(const Vector&); WSWindow& window() { return *m_window; } const WSWindow& window() const { return *m_window; } void handle_menu_mouse_event(WSMenu&, const WSMouseEvent&); void draw(); void tick_clock(); RefPtr m_window; WSCPUMonitor m_cpu_monitor; String m_username; RefPtr m_timer; WeakPtr m_current_menu; Vector> m_open_menu_stack; RefPtr m_muted_bitmap; RefPtr m_unmuted_bitmap; OwnPtr m_audio_client; Rect m_audio_rect; bool m_needs_window_resize { false }; bool m_bar_open { false }; bool m_audio_muted { false }; };