mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
GMLCompiler: Add a variety of special cases
Headers, enum properties, and associated default includes.
This commit is contained in:
parent
a24d9f5e22
commit
842a5adfdc
Notes:
sideshowbarker
2024-07-17 06:28:38 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/842a5adfdc Pull-request: https://github.com/SerenityOS/serenity/pull/20523 Reviewed-by: https://github.com/ADKaster
1 changed files with 6 additions and 0 deletions
|
@ -27,10 +27,14 @@ static Optional<StringView> map_class_to_file(StringView class_)
|
|||
static HashMap<StringView, StringView> class_file_mappings {
|
||||
{ "GUI::HorizontalSplitter"sv, "GUI/Splitter"sv },
|
||||
{ "GUI::VerticalSplitter"sv, "GUI/Splitter"sv },
|
||||
{ "GUI::HorizontalSeparator"sv, "GUI/SeparatorWidget"sv },
|
||||
{ "GUI::VerticalSeparator"sv, "GUI/SeparatorWidget"sv },
|
||||
{ "GUI::HorizontalBoxLayout"sv, "GUI/BoxLayout"sv },
|
||||
{ "GUI::VerticalBoxLayout"sv, "GUI/BoxLayout"sv },
|
||||
{ "GUI::HorizontalProgressbar"sv, "GUI/Progressbar"sv },
|
||||
{ "GUI::VerticalProgressbar"sv, "GUI/Progressbar"sv },
|
||||
{ "GUI::DialogButton"sv, "GUI/Button"sv },
|
||||
{ "GUI::PasswordBox"sv, "GUI/TextBox"sv },
|
||||
// Map Layout::Spacer to the Layout header even though it's a pseudo class.
|
||||
{ "GUI::Layout::Spacer"sv, "GUI/Layout"sv },
|
||||
};
|
||||
|
@ -333,6 +337,8 @@ static ErrorOr<String> generate_cpp(NonnullRefPtr<GUI::GML::GMLFile> gml)
|
|||
TRY(String::from_utf8("<AK/JsonValue.h>"sv)),
|
||||
TRY(String::from_utf8("<AK/NonnullRefPtr.h>"sv)),
|
||||
TRY(String::from_utf8("<AK/RefPtr.h>"sv)),
|
||||
// For Gfx::ColorRole
|
||||
TRY(String::from_utf8("<LibGfx/SystemTheme.h>"sv)),
|
||||
TRY(String::from_utf8("<LibGUI/Widget.h>"sv)),
|
||||
};
|
||||
TRY(necessary_includes.try_set_from(always_necessary_includes));
|
||||
|
|
Loading…
Reference in a new issue