mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +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
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…
Add table
Add a link
Reference in a new issue