From b011ea9962ec66e9ff1793e278ffb91239324528 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 15 Feb 2020 01:56:30 +0100 Subject: LibGUI: Reduce menu-related header dependencies --- Libraries/LibGUI/Menu.cpp | 1 + Libraries/LibGUI/Menu.h | 2 +- Libraries/LibGUI/MenuBar.cpp | 3 +++ Libraries/LibGUI/MenuBar.h | 6 +++--- Libraries/LibGUI/MenuItem.cpp | 10 ++++++++++ Libraries/LibGUI/MenuItem.h | 10 ++++------ 6 files changed, 22 insertions(+), 10 deletions(-) (limited to 'Libraries/LibGUI') diff --git a/Libraries/LibGUI/Menu.cpp b/Libraries/LibGUI/Menu.cpp index cc5455a6b0..45a8485e77 100644 --- a/Libraries/LibGUI/Menu.cpp +++ b/Libraries/LibGUI/Menu.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/Libraries/LibGUI/Menu.h b/Libraries/LibGUI/Menu.h index a1e8b094ce..9d7c537e3d 100644 --- a/Libraries/LibGUI/Menu.h +++ b/Libraries/LibGUI/Menu.h @@ -30,12 +30,12 @@ #include #include #include -#include #include namespace GUI { class Action; +class MenuItem; class Menu final : public Core::Object { C_OBJECT(Menu) diff --git a/Libraries/LibGUI/MenuBar.cpp b/Libraries/LibGUI/MenuBar.cpp index c674c77443..7cb671b5f5 100644 --- a/Libraries/LibGUI/MenuBar.cpp +++ b/Libraries/LibGUI/MenuBar.cpp @@ -24,7 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include #include +#include #include namespace GUI { diff --git a/Libraries/LibGUI/MenuBar.h b/Libraries/LibGUI/MenuBar.h index 2e94696d5a..751903f15d 100644 --- a/Libraries/LibGUI/MenuBar.h +++ b/Libraries/LibGUI/MenuBar.h @@ -26,13 +26,13 @@ #pragma once -#include -#include -#include +#include +#include namespace GUI { class Application; +class Menu; class MenuBar { public: diff --git a/Libraries/LibGUI/MenuItem.cpp b/Libraries/LibGUI/MenuItem.cpp index 1a5dd05eec..8b75a45e69 100644 --- a/Libraries/LibGUI/MenuItem.cpp +++ b/Libraries/LibGUI/MenuItem.cpp @@ -88,4 +88,14 @@ void MenuItem::update_window_server() WindowServerConnection::the().send_sync(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, shortcut_text); } +void MenuItem::set_menu_id(Badge, unsigned int menu_id) +{ + m_menu_id = menu_id; +} + +void MenuItem::set_identifier(Badge, unsigned identifier) +{ + m_identifier = identifier; +} + } diff --git a/Libraries/LibGUI/MenuItem.h b/Libraries/LibGUI/MenuItem.h index d243dba7b4..f8c7a439ae 100644 --- a/Libraries/LibGUI/MenuItem.h +++ b/Libraries/LibGUI/MenuItem.h @@ -26,10 +26,8 @@ #pragma once -#include -#include -#include -#include +#include +#include namespace GUI { @@ -68,8 +66,8 @@ public: bool is_enabled() const { return m_enabled; } void set_enabled(bool); - void set_menu_id(Badge, unsigned menu_id) { m_menu_id = menu_id; } - void set_identifier(Badge, unsigned identifier) { m_identifier = identifier; } + void set_menu_id(Badge, unsigned menu_id); + void set_identifier(Badge, unsigned identifier); private: void update_window_server(); -- cgit v1.2.3