mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
WindowServer: Let menu objects reference the WSClientConnection by pointer.
Since these are owner/ownee relationships, there's no need for indirection.
This commit is contained in:
parent
459cc23441
commit
fa452fadca
6 changed files with 19 additions and 16 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <SharedGraphics/Rect.h>
|
||||
#include "WSMenuItem.h"
|
||||
|
||||
class WSClientConnection;
|
||||
class WSMenuBar;
|
||||
class WSMessage;
|
||||
class WSWindow;
|
||||
|
@ -13,10 +14,11 @@ class Font;
|
|||
|
||||
class WSMenu : public Weakable<WSMenu> {
|
||||
public:
|
||||
WSMenu(int client_id, int menu_id, String&& name);
|
||||
WSMenu(WSClientConnection*, int menu_id, String&& name);
|
||||
~WSMenu();
|
||||
|
||||
int client_id() const { return m_client_id; }
|
||||
WSClientConnection* client() { return m_client; }
|
||||
const WSClientConnection* client() const { return m_client; }
|
||||
int menu_id() const { return m_menu_id; }
|
||||
|
||||
WSMenuBar* menu_bar() { return m_menubar; }
|
||||
|
@ -74,7 +76,7 @@ public:
|
|||
|
||||
private:
|
||||
void did_activate(WSMenuItem&);
|
||||
int m_client_id { 0 };
|
||||
WSClientConnection* m_client { nullptr };
|
||||
int m_menu_id { 0 };
|
||||
String m_name;
|
||||
Rect m_rect_in_menubar;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue