2019-02-11 14:43:43 +01:00
|
|
|
#pragma once
|
|
|
|
|
2019-03-03 12:32:15 +01:00
|
|
|
#include <AK/Badge.h>
|
2019-02-11 14:43:43 +01:00
|
|
|
#include <AK/OwnPtr.h>
|
2019-03-03 12:32:15 +01:00
|
|
|
#include <AK/HashMap.h>
|
|
|
|
#include <LibGUI/GShortcut.h>
|
2019-02-11 14:43:43 +01:00
|
|
|
|
2019-03-03 12:32:15 +01:00
|
|
|
class GAction;
|
|
|
|
class GKeyEvent;
|
2019-02-11 14:43:43 +01:00
|
|
|
class GEventLoop;
|
|
|
|
class GMenuBar;
|
|
|
|
|
|
|
|
class GApplication {
|
|
|
|
public:
|
2019-02-11 14:56:23 +01:00
|
|
|
static GApplication& the();
|
2019-02-11 14:43:43 +01:00
|
|
|
GApplication(int argc, char** argv);
|
2019-02-11 14:56:23 +01:00
|
|
|
~GApplication();
|
2019-02-11 14:43:43 +01:00
|
|
|
|
|
|
|
int exec();
|
2019-02-17 09:58:35 +01:00
|
|
|
void quit(int);
|
2019-02-11 14:43:43 +01:00
|
|
|
|
|
|
|
void set_menubar(OwnPtr<GMenuBar>&&);
|
2019-03-03 12:32:15 +01:00
|
|
|
GAction* action_for_key_event(const GKeyEvent&);
|
|
|
|
|
|
|
|
void register_shortcut_action(Badge<GAction>, GAction&);
|
|
|
|
void unregister_shortcut_action(Badge<GAction>, GAction&);
|
2019-02-11 14:43:43 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
OwnPtr<GEventLoop> m_event_loop;
|
|
|
|
OwnPtr<GMenuBar> m_menubar;
|
2019-03-03 12:32:15 +01:00
|
|
|
HashMap<GShortcut, GAction*> m_shortcut_actions;
|
2019-02-11 14:43:43 +01:00
|
|
|
};
|