mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:38:10 +00:00

I'm going with a global top-of-the-screen menu instead of per-window menus. The basic idea is that menus will live in the WindowServer and clients can create menus via WindowServer requests.
24 lines
434 B
C++
24 lines
434 B
C++
#pragma once
|
|
|
|
#include "WSMenu.h"
|
|
#include <AK/Vector.h>
|
|
|
|
class WSMenuBar {
|
|
public:
|
|
WSMenuBar();
|
|
~WSMenuBar();
|
|
|
|
void add_menu(OwnPtr<WSMenu>&& menu) { m_menus.append(move(menu)); }
|
|
|
|
template<typename Callback>
|
|
void for_each_menu(Callback callback)
|
|
{
|
|
for (auto& menu : m_menus) {
|
|
if (!callback(*menu))
|
|
return;
|
|
}
|
|
}
|
|
|
|
private:
|
|
Vector<OwnPtr<WSMenu>> m_menus;
|
|
};
|