mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
5e40aa4f1a
I'm gonna want to have nested event loops sooner or later, so let's not pollute GEventLoop with things that are meant to work globally. This patch also changes key events to pass around their modifiers as a bitfield all the way around the system instead of breaking them up.
33 lines
697 B
C++
33 lines
697 B
C++
#pragma once
|
|
|
|
#include <AK/Badge.h>
|
|
#include <AK/OwnPtr.h>
|
|
#include <AK/HashMap.h>
|
|
#include <LibGUI/GShortcut.h>
|
|
|
|
class GAction;
|
|
class GKeyEvent;
|
|
class GEventLoop;
|
|
class GMenuBar;
|
|
|
|
class GApplication {
|
|
public:
|
|
static GApplication& the();
|
|
GApplication(int argc, char** argv);
|
|
~GApplication();
|
|
|
|
int exec();
|
|
void quit(int);
|
|
|
|
void set_menubar(OwnPtr<GMenuBar>&&);
|
|
GAction* action_for_key_event(const GKeyEvent&);
|
|
|
|
void register_shortcut_action(Badge<GAction>, GAction&);
|
|
void unregister_shortcut_action(Badge<GAction>, GAction&);
|
|
|
|
private:
|
|
OwnPtr<GEventLoop> m_event_loop;
|
|
OwnPtr<GMenuBar> m_menubar;
|
|
HashMap<GShortcut, GAction*> m_shortcut_actions;
|
|
};
|