mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 12:05:06 +00:00
LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being consistent about how this stuff works. The new convention is: - "LibFoo" is a userspace library that provides the "Foo" namespace. That's it :^) This was pretty tedious to convert and I didn't even start on LibGUI yet. But it's coming up next.
This commit is contained in:
parent
b7e3810b5c
commit
2d39da5405
265 changed files with 1380 additions and 1167 deletions
|
@ -32,52 +32,52 @@
|
|||
|
||||
namespace GCommonActions {
|
||||
|
||||
NonnullRefPtr<GAction> make_open_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_open_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Open...", { Mod_Ctrl, Key_O }, GraphicsBitmap::load_from_file("/res/icons/16x16/open.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_move_to_front_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_move_to_front_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Move to front", { Mod_Ctrl | Mod_Shift, Key_Up }, GraphicsBitmap::load_from_file("/res/icons/16x16/move-to-front.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_move_to_back_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_move_to_back_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Move to back", { Mod_Ctrl | Mod_Shift, Key_Down }, GraphicsBitmap::load_from_file("/res/icons/16x16/move-to-back.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_undo_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_undo_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Undo", { Mod_Ctrl, Key_Z }, GraphicsBitmap::load_from_file("/res/icons/16x16/undo.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_redo_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_redo_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Redo", { Mod_Ctrl, Key_Y }, GraphicsBitmap::load_from_file("/res/icons/16x16/redo.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_delete_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_delete_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Delete", { Mod_None, Key_Delete }, GraphicsBitmap::load_from_file("/res/icons/16x16/delete.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_cut_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_cut_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Cut", { Mod_Ctrl, Key_X }, GraphicsBitmap::load_from_file("/res/icons/cut16.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_copy_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_copy_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Copy", { Mod_Ctrl, Key_C }, GraphicsBitmap::load_from_file("/res/icons/16x16/edit-copy.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_paste_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_paste_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Paste", { Mod_Ctrl, Key_V }, GraphicsBitmap::load_from_file("/res/icons/paste16.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_fullscreen_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_fullscreen_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Fullscreen", { Mod_None, Key_F11 }, move(callback), parent);
|
||||
}
|
||||
|
@ -87,58 +87,58 @@ NonnullRefPtr<GAction> make_quit_action(Function<void(GAction&)> callback)
|
|||
return GAction::create("Quit", { Mod_Alt, Key_F4 }, move(callback));
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_go_back_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_go_back_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Go back", { Mod_Alt, Key_Left }, GraphicsBitmap::load_from_file("/res/icons/16x16/go-back.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_go_forward_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_go_forward_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Go forward", { Mod_Alt, Key_Right }, GraphicsBitmap::load_from_file("/res/icons/16x16/go-forward.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_go_home_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_go_home_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Go home", { Mod_Alt, Key_Home }, GraphicsBitmap::load_from_file("/res/icons/16x16/go-home.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_reload_action(Function<void(GAction&)> callback, CObject* parent)
|
||||
NonnullRefPtr<GAction> make_reload_action(Function<void(GAction&)> callback, Core::Object* parent)
|
||||
{
|
||||
return GAction::create("Reload", { Mod_Ctrl, Key_R }, GraphicsBitmap::load_from_file("/res/icons/16x16/reload.png"), move(callback), parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GAction::GAction(const StringView& text, Function<void(GAction&)> on_activation_callback, CObject* parent)
|
||||
: CObject(parent)
|
||||
GAction::GAction(const StringView& text, Function<void(GAction&)> on_activation_callback, Core::Object* parent)
|
||||
: Core::Object(parent)
|
||||
, on_activation(move(on_activation_callback))
|
||||
, m_text(text)
|
||||
{
|
||||
}
|
||||
|
||||
GAction::GAction(const StringView& text, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, CObject* parent)
|
||||
: CObject(parent)
|
||||
GAction::GAction(const StringView& text, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, Core::Object* parent)
|
||||
: Core::Object(parent)
|
||||
, on_activation(move(on_activation_callback))
|
||||
, m_text(text)
|
||||
, m_icon(move(icon))
|
||||
{
|
||||
}
|
||||
|
||||
GAction::GAction(const StringView& text, const GShortcut& shortcut, Function<void(GAction&)> on_activation_callback, CObject* parent)
|
||||
GAction::GAction(const StringView& text, const GShortcut& shortcut, Function<void(GAction&)> on_activation_callback, Core::Object* parent)
|
||||
: GAction(text, shortcut, nullptr, move(on_activation_callback), parent)
|
||||
{
|
||||
}
|
||||
|
||||
GAction::GAction(const StringView& text, const GShortcut& shortcut, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, CObject* parent)
|
||||
: CObject(parent)
|
||||
GAction::GAction(const StringView& text, const GShortcut& shortcut, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, Core::Object* parent)
|
||||
: Core::Object(parent)
|
||||
, on_activation(move(on_activation_callback))
|
||||
, m_text(text)
|
||||
, m_icon(move(icon))
|
||||
, m_shortcut(shortcut)
|
||||
{
|
||||
if (parent && is<GWidget>(*parent)) {
|
||||
if (parent && Core::is<GWidget>(*parent)) {
|
||||
m_scope = ShortcutScope::WidgetLocal;
|
||||
} else if (parent && is<GWindow>(*parent)) {
|
||||
} else if (parent && Core::is<GWindow>(*parent)) {
|
||||
m_scope = ShortcutScope::WindowLocal;
|
||||
} else {
|
||||
m_scope = ShortcutScope::ApplicationGlobal;
|
||||
|
@ -152,7 +152,7 @@ GAction::~GAction()
|
|||
GApplication::the().unregister_global_shortcut_action({}, *this);
|
||||
}
|
||||
|
||||
void GAction::activate(CObject* activator)
|
||||
void GAction::activate(Core::Object* activator)
|
||||
{
|
||||
if (activator)
|
||||
m_activator = activator->make_weak_ptr();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue