mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 15:15:07 +00:00
LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
This commit is contained in:
parent
2d39da5405
commit
c5bd9d4ed1
337 changed files with 5400 additions and 4816 deletions
|
@ -27,34 +27,36 @@
|
|||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GWindowServerConnection.h>
|
||||
|
||||
GMenuBar::GMenuBar()
|
||||
namespace GUI {
|
||||
|
||||
MenuBar::MenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
GMenuBar::~GMenuBar()
|
||||
MenuBar::~MenuBar()
|
||||
{
|
||||
unrealize_menubar();
|
||||
}
|
||||
|
||||
void GMenuBar::add_menu(NonnullRefPtr<GMenu> menu)
|
||||
void MenuBar::add_menu(NonnullRefPtr<Menu> menu)
|
||||
{
|
||||
m_menus.append(move(menu));
|
||||
}
|
||||
|
||||
int GMenuBar::realize_menubar()
|
||||
int MenuBar::realize_menubar()
|
||||
{
|
||||
return GWindowServerConnection::the().send_sync<WindowServer::CreateMenubar>()->menubar_id();
|
||||
return WindowServerConnection::the().send_sync<WindowServer::CreateMenubar>()->menubar_id();
|
||||
}
|
||||
|
||||
void GMenuBar::unrealize_menubar()
|
||||
void MenuBar::unrealize_menubar()
|
||||
{
|
||||
if (m_menubar_id == -1)
|
||||
return;
|
||||
GWindowServerConnection::the().send_sync<WindowServer::DestroyMenubar>(m_menubar_id);
|
||||
WindowServerConnection::the().send_sync<WindowServer::DestroyMenubar>(m_menubar_id);
|
||||
m_menubar_id = -1;
|
||||
}
|
||||
|
||||
void GMenuBar::notify_added_to_application(Badge<GApplication>)
|
||||
void MenuBar::notify_added_to_application(Badge<Application>)
|
||||
{
|
||||
ASSERT(m_menubar_id == -1);
|
||||
m_menubar_id = realize_menubar();
|
||||
|
@ -62,12 +64,14 @@ void GMenuBar::notify_added_to_application(Badge<GApplication>)
|
|||
for (auto& menu : m_menus) {
|
||||
int menu_id = menu.realize_menu();
|
||||
ASSERT(menu_id != -1);
|
||||
GWindowServerConnection::the().send_sync<WindowServer::AddMenuToMenubar>(m_menubar_id, menu_id);
|
||||
WindowServerConnection::the().send_sync<WindowServer::AddMenuToMenubar>(m_menubar_id, menu_id);
|
||||
}
|
||||
GWindowServerConnection::the().send_sync<WindowServer::SetApplicationMenubar>(m_menubar_id);
|
||||
WindowServerConnection::the().send_sync<WindowServer::SetApplicationMenubar>(m_menubar_id);
|
||||
}
|
||||
|
||||
void GMenuBar::notify_removed_from_application(Badge<GApplication>)
|
||||
void MenuBar::notify_removed_from_application(Badge<Application>)
|
||||
{
|
||||
unrealize_menubar();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue