mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
WindowServer: Start implementing a menu system.
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.
This commit is contained in:
parent
7abef6ba9e
commit
443b043b49
14 changed files with 487 additions and 6 deletions
24
WindowServer/WSMenuBar.h
Normal file
24
WindowServer/WSMenuBar.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue