1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

WindowServer: More work on the menu system.

Menus are now tied to a Process (by WeakPtr.) This will allow us to pass
notifications to the correct event stream.
This commit is contained in:
Andreas Kling 2019-02-12 08:39:19 +01:00
parent 133706d697
commit 15b4c9f9f1
7 changed files with 43 additions and 39 deletions

View file

@ -2,6 +2,7 @@
#include <AK/AKString.h>
#include <AK/Vector.h>
#include <AK/WeakPtr.h>
#include <SharedGraphics/Rect.h>
#include "WSMenuItem.h"
@ -9,10 +10,11 @@ class WSMenuBar;
class WSMessage;
class WSWindow;
class Font;
class Process;
class WSMenu {
public:
WSMenu(int menu_id, String&& name);
WSMenu(Process&, int menu_id, String&& name);
~WSMenu();
int menu_id() const { return m_menu_id; }
@ -80,5 +82,6 @@ private:
WSMenuItem* m_hovered_item { nullptr };
Vector<OwnPtr<WSMenuItem>> m_items;
OwnPtr<WSWindow> m_menu_window;
WeakPtr<Process> m_process;
};