1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:55:09 +00:00

Port all apps to GApplication.

This commit is contained in:
Andreas Kling 2019-02-11 14:56:23 +01:00
parent 9483b39227
commit 3351f1ccc1
10 changed files with 48 additions and 106 deletions

View file

@ -2,8 +2,18 @@
#include <LibGUI/GEventLoop.h>
#include <LibGUI/GMenuBar.h>
static GApplication* s_the;
GApplication& GApplication::the()
{
ASSERT(s_the);
return *s_the;
}
GApplication::GApplication(int argc, char** argv)
{
ASSERT(!s_the);
s_the = this;
m_event_loop = make<GEventLoop>();
}
@ -16,6 +26,11 @@ int GApplication::exec()
return m_event_loop->exec();
}
void GApplication::exit(int exit_code)
{
m_event_loop->exit(exit_code);
}
void GApplication::set_menubar(OwnPtr<GMenuBar>&& menubar)
{
m_menubar = move(menubar);