1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:27:45 +00:00

LibGUI: Remove GML prefix in favor of proper namespace

Prefixes are very much a C thing which we don't need in C++. This commit
moves all GML-related classes in LibGUI into the GUI::GML namespace, a
change somewhat overdue.
This commit is contained in:
kleines Filmröllchen 2022-02-02 18:11:29 +01:00 committed by Andreas Kling
parent 89201b682b
commit 4931c88b13
17 changed files with 129 additions and 125 deletions

View file

@ -12,10 +12,10 @@
#include <LibDesktop/Launcher.h>
#include <LibGUI/Application.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/GMLAutocompleteProvider.h>
#include <LibGUI/GMLFormatter.h>
#include <LibGUI/GMLLexer.h>
#include <LibGUI/GMLSyntaxHighlighter.h>
#include <LibGUI/GML/AutocompleteProvider.h>
#include <LibGUI/GML/Formatter.h>
#include <LibGUI/GML/Lexer.h>
#include <LibGUI/GML/SyntaxHighlighter.h>
#include <LibGUI/Icon.h>
#include <LibGUI/Menu.h>
#include <LibGUI/Menubar.h>
@ -87,8 +87,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto editor = TRY(splitter->try_add<GUI::TextEditor>());
auto preview = TRY(splitter->try_add<GUI::Frame>());
editor->set_syntax_highlighter(make<GUI::GMLSyntaxHighlighter>());
editor->set_autocomplete_provider(make<GUI::GMLAutocompleteProvider>());
editor->set_syntax_highlighter(make<GUI::GML::SyntaxHighlighter>());
editor->set_autocomplete_provider(make<GUI::GML::AutocompleteProvider>());
editor->set_should_autocomplete_automatically(true);
editor->set_automatic_indentation_enabled(true);
editor->set_ruler_visible(true);
@ -215,9 +215,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto edit_menu = TRY(window->try_add_menu("&Edit"));
TRY(edit_menu->try_add_action(GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, [&](auto&) {
auto source = editor->text();
GUI::GMLLexer lexer(source);
GUI::GML::Lexer lexer(source);
for (auto& token : lexer.lex()) {
if (token.m_type == GUI::GMLToken::Type::Comment) {
if (token.m_type == GUI::GML::Token::Type::Comment) {
auto result = GUI::MessageBox::show(
window,
"Your GML contains comments, which currently are not supported by the formatter and will be removed. Proceed?",
@ -229,7 +229,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
break;
}
}
auto formatted_gml = GUI::format_gml(source);
auto formatted_gml = GUI::GML::format_gml(source);
if (!formatted_gml.is_null()) {
editor->set_text(formatted_gml);
} else {