1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +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:
Andreas Kling 2020-02-02 15:07:41 +01:00
parent 2d39da5405
commit c5bd9d4ed1
337 changed files with 5400 additions and 4816 deletions

View file

@ -31,31 +31,33 @@
#include <AK/OwnPtr.h>
#include <AK/String.h>
class GAction;
class GMenu;
namespace GUI {
class GMenuItem {
class Action;
class Menu;
class MenuItem {
public:
enum Type {
enum class Type {
Invalid,
Action,
Separator,
Submenu,
};
GMenuItem(unsigned menu_id, Type);
GMenuItem(unsigned menu_id, NonnullRefPtr<GAction>&&);
GMenuItem(unsigned menu_id, NonnullRefPtr<GMenu>&&);
~GMenuItem();
MenuItem(unsigned menu_id, Type);
MenuItem(unsigned menu_id, NonnullRefPtr<Action>&&);
MenuItem(unsigned menu_id, NonnullRefPtr<Menu>&&);
~MenuItem();
Type type() const { return m_type; }
String text() const;
const GAction* action() const { return m_action.ptr(); }
GAction* action() { return m_action.ptr(); }
const Action* action() const { return m_action.ptr(); }
Action* action() { return m_action.ptr(); }
unsigned identifier() const { return m_identifier; }
GMenu* submenu() { return m_submenu.ptr(); }
const GMenu* submenu() const { return m_submenu.ptr(); }
Menu* submenu() { return m_submenu.ptr(); }
const Menu* submenu() const { return m_submenu.ptr(); }
bool is_checkable() const { return m_checkable; }
void set_checkable(bool checkable) { m_checkable = checkable; }
@ -66,18 +68,20 @@ public:
bool is_enabled() const { return m_enabled; }
void set_enabled(bool);
void set_menu_id(Badge<GMenu>, unsigned menu_id) { m_menu_id = menu_id; }
void set_identifier(Badge<GMenu>, unsigned identifier) { m_identifier = identifier; }
void set_menu_id(Badge<Menu>, unsigned menu_id) { m_menu_id = menu_id; }
void set_identifier(Badge<Menu>, unsigned identifier) { m_identifier = identifier; }
private:
void update_window_server();
Type m_type { Invalid };
Type m_type { Type::Invalid };
int m_menu_id { -1 };
unsigned m_identifier { 0 };
bool m_enabled { true };
bool m_checkable { false };
bool m_checked { false };
RefPtr<GAction> m_action;
RefPtr<GMenu> m_submenu;
RefPtr<Action> m_action;
RefPtr<Menu> m_submenu;
};
}