
Clicking on this icon toggles the AudioServer muted state. It currently does not react to muted state changes caused by other programs, since it has no way of learning about those from AudioServer, other than performing a synchronous IPC call (GetMuted), which we don't want to be doing in the WindowServer :^)
65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "WSMenu.h"
|
|
#include <LibCore/CObject.h>
|
|
#include <LibCore/CTimer.h>
|
|
#include <WindowServer/WSCPUMonitor.h>
|
|
#include <WindowServer/WSWindow.h>
|
|
|
|
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<WeakPtr<WSMenu>>& 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<WSMenu*>&);
|
|
|
|
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<WSWindow> m_window;
|
|
WSCPUMonitor m_cpu_monitor;
|
|
String m_username;
|
|
RefPtr<CTimer> m_timer;
|
|
|
|
WeakPtr<WSMenu> m_current_menu;
|
|
Vector<WeakPtr<WSMenu>> m_open_menu_stack;
|
|
|
|
RefPtr<GraphicsBitmap> m_muted_bitmap;
|
|
RefPtr<GraphicsBitmap> m_unmuted_bitmap;
|
|
|
|
OwnPtr<AClientConnection> m_audio_client;
|
|
|
|
Rect m_audio_rect;
|
|
|
|
bool m_needs_window_resize { false };
|
|
bool m_bar_open { false };
|
|
bool m_audio_muted { false };
|
|
};
|