mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:58:12 +00:00
Move WindowServer into Servers.
This commit is contained in:
parent
9120b05a40
commit
d17a91f185
32 changed files with 14 additions and 14 deletions
31
Servers/WindowServer/WSMenuBar.h
Normal file
31
Servers/WindowServer/WSMenuBar.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include "WSMenu.h"
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
|
||||
class WSMenuBar : public Weakable<WSMenuBar> {
|
||||
public:
|
||||
WSMenuBar(WSClientConnection& client, int menubar_id);
|
||||
~WSMenuBar();
|
||||
|
||||
WSClientConnection& client() { return m_client; }
|
||||
const WSClientConnection& client() const { return m_client; }
|
||||
int menubar_id() const { return m_menubar_id; }
|
||||
void add_menu(WSMenu* menu) { m_menus.append(menu); }
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_menu(Callback callback)
|
||||
{
|
||||
for (auto& menu : m_menus) {
|
||||
if (!callback(*menu))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
WSClientConnection& m_client;
|
||||
int m_menubar_id { 0 };
|
||||
Vector<WSMenu*> m_menus;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue