-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GMLCompiler+LibGUI: Various GML compiler fixes #20523
Merged
ADKaster
merged 8 commits into
SerenityOS:master
from
kleinesfilmroellchen:gml-compiler-fixes
Aug 12, 2023
Merged
GMLCompiler+LibGUI: Various GML compiler fixes #20523
ADKaster
merged 8 commits into
SerenityOS:master
from
kleinesfilmroellchen:gml-compiler-fixes
Aug 12, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's the "font_type" property which currently only handles fixed-width yes/no, so until we get a proper font type enum and associated enum property, this is better to use from GML instead of a special case in the GML compiler.
We don't want a newline to cause havoc.
github-actions
bot
added
the
👀 pr-needs-review
PR needs review from a maintainer or community member
label
Aug 12, 2023
As with other special cases, this depends on the property name. The UIDimension code is kept separate since it can handle both integers and strings, and the string names for special dimensions don't match with the enum names.
Headers, enum properties, and associated default includes.
Calculator would otherwise trip over this, since there's a class with the same name within the namespace.
This is accomplished by detecting the Userland subdirectory from the GML file's own path. Thereby, any Userland program, e.g. applet, application, or even service, can use GML and the include paths of the generated files will be correct.
kleinesfilmroellchen
force-pushed
the
gml-compiler-fixes
branch
from
August 12, 2023 14:51
36887f4
to
fb97e1b
Compare
ADKaster
reviewed
Aug 12, 2023
@@ -90,19 +91,24 @@ static ErrorOr<String> include_path_for(StringView class_name) | |||
return String::formatted("<Lib{}.h>", pathed_name); | |||
|
|||
// We assume that all other paths are within the current application, for now. | |||
return String::formatted("<Applications/{}.h>", pathed_name); | |||
// To figure out what kind of userland program this is (application, service, ...) we consider the path to the original GML file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future it would be nice to not make such assumptions about the project path, e.g. when using from within serenity or without the serenity source tree on hand. (third party apps etc). The build system should be able to pass this sort of information in.
github-actions
bot
removed
the
👀 pr-needs-review
PR needs review from a maintainer or community member
label
Aug 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a collection of commits that make several applications (CertificateSettings, CalendarSettings, Calendar, Calculator, BrowserSettings, Run, LoginServer) work with the compiler. As far as I can tell, this covers many common cases I missed while preparing the original GML compiler PR with just Help. I will submit the applications separately as another PR to not make this too large, since this PR contains the more complicated changes.
LibGUI: Add direct property for fixed-width font
There's the "font_type" property which currently only handles
fixed-width yes/no, so until we get a proper font type enum and
associated enum property, this is better to use from GML instead of a
special case in the GML compiler.
GMLCompiler: Handle spacer pseudo-objects
GMLCompiler: Escape compiled strings
We don't want a newline to cause havoc.
GMLCompiler: Allow generating enum constants from strings
As with other special cases, this depends on the property name.
The UIDimension code is kept separate since it can handle both integers
and strings, and the string names for special dimensions don't match
with the enum names.
GMLCompiler: Handle bitmap properties
GMLCompiler: Add a variety of special cases
Headers, enum properties, and associated default includes.
GMLCompiler: Force main class name to be resolved from global namespace
Calculator would otherwise trip over this, since there's a class with
the same name within the namespace.
GMLCompiler: Allow using GML in any kind of Userland program
This is accomplished by detecting the Userland subdirectory from the GML
file's own path. Thereby, any Userland program, e.g. applet,
application, or even service, can use GML and the include paths of the
generated files will be correct.