diff --git a/LibGUI/GApplication.cpp b/LibGUI/GApplication.cpp new file mode 100644 index 00000000000..5e5e786d8d6 --- /dev/null +++ b/LibGUI/GApplication.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +GApplication::GApplication(int argc, char** argv) +{ + m_event_loop = make(); +} + +GApplication::~GApplication() +{ +} + +int GApplication::exec() +{ + return m_event_loop->exec(); +} + +void GApplication::set_menubar(OwnPtr&& menubar) +{ + m_menubar = move(menubar); +} + diff --git a/LibGUI/GApplication.h b/LibGUI/GApplication.h new file mode 100644 index 00000000000..eff2c11e222 --- /dev/null +++ b/LibGUI/GApplication.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +class GEventLoop; +class GMenuBar; + +class GApplication { +public: + GApplication(int argc, char** argv); + + int exec(); + + void set_menubar(OwnPtr&&); + +private: + OwnPtr m_event_loop; + OwnPtr m_menubar; +}; diff --git a/LibGUI/GMenu.cpp b/LibGUI/GMenu.cpp new file mode 100644 index 00000000000..ca276a0d857 --- /dev/null +++ b/LibGUI/GMenu.cpp @@ -0,0 +1,11 @@ +#include + +GMenu::GMenu() +{ +} + +GMenu::~GMenu() +{ +} + + diff --git a/LibGUI/GMenu.h b/LibGUI/GMenu.h new file mode 100644 index 00000000000..f567e12eeea --- /dev/null +++ b/LibGUI/GMenu.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +class GMenu { +public: + GMenu(); + ~GMenu(); + +private: + Vector m_items; +}; diff --git a/LibGUI/GMenuBar.cpp b/LibGUI/GMenuBar.cpp new file mode 100644 index 00000000000..77084da277a --- /dev/null +++ b/LibGUI/GMenuBar.cpp @@ -0,0 +1,9 @@ +#include + +GMenuBar::GMenuBar() +{ +} + +GMenuBar::~GMenuBar() +{ +} diff --git a/LibGUI/GMenuBar.h b/LibGUI/GMenuBar.h new file mode 100644 index 00000000000..f9263226abc --- /dev/null +++ b/LibGUI/GMenuBar.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +class GMenuBar { +public: + GMenuBar(); + ~GMenuBar(); + +private: + Vector m_menus; +}; diff --git a/LibGUI/GMenuItem.cpp b/LibGUI/GMenuItem.cpp new file mode 100644 index 00000000000..0aebf1cf6d9 --- /dev/null +++ b/LibGUI/GMenuItem.cpp @@ -0,0 +1,18 @@ +#include + +GMenuItem::GMenuItem(Type type) + : m_type(type) +{ +} + +GMenuItem::GMenuItem(unsigned identifier, const String& text) + : m_type(Text) + , m_identifier(identifier) + , m_text(text) +{ +} + +GMenuItem::~GMenuItem() +{ +} + diff --git a/LibGUI/GMenuItem.h b/LibGUI/GMenuItem.h new file mode 100644 index 00000000000..48675e303f9 --- /dev/null +++ b/LibGUI/GMenuItem.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +class GMenuItem { +public: + enum Type { Invalid, Text, Separator }; + + explicit GMenuItem(Type); + GMenuItem(unsigned identifier, const String& text); + ~GMenuItem(); + + Type type() const { return m_type; } + String text() const { return m_text; } + unsigned identifier() const { return m_identifier; } + +private: + Type m_type { Invalid }; + unsigned m_identifier { 0 }; + String m_text; +}; + diff --git a/LibGUI/Makefile b/LibGUI/Makefile index 36167d42ade..e9e2f3283e9 100644 --- a/LibGUI/Makefile +++ b/LibGUI/Makefile @@ -21,6 +21,9 @@ LIBGUI_OBJS = \ GStyle.o \ GLayout.o \ GBoxLayout.o \ + GMenuBar.o \ + GMenu.o \ + GMenuItem.o \ GWindow.o OBJS = $(SHAREDGRAPHICS_OBJS) $(LIBGUI_OBJS)