summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/GML
AgeCommit message (Collapse)Author
2023-03-15LibSyntax+Libraries: Replace TextStyle with Gfx::TextAttributesSam Atkins
Rather than creating a TextStyle struct, and then copying its fields over to a TextAttributes, let's just create a TextAttributes to start with. This also simplifies the syntax highlighting code by letting us define underlines along with the other text styling.
2023-03-06Everywhere: Remove NonnullRefPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullRefPtrVectorAndreas Kling
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-02-28LibGUI: Assign folding regions for GML filesSam Atkins
Each {} block is now treated as a folding region, so that they can be collapsed and expanded in TextEditor, GML Playground, HackStudio, and anywhere else that uses the syntax highlighter. :^)
2023-02-21LibGUI: Fix const-correctness issuesAndreas Kling
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2023-01-02Everywhere: Remove unused includes of AK/IterationDecision.hBen Wiederhake
These instances were detected by searching for files that include IterationDecision.h, but don't match the regex: \\bIterationDecision(?!\.h>)\\b This is the only symbol defined by IterationDecision.h. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
2023-01-01LibCore+LibGUI: Add fallible versions of Widget::load_from_gml()Sam Atkins
The existing `load_from_gml()` methods look the same as before from the outside. Inside though, they now forward to `try_load_from_gml()` which returns Error when things go wrong. It also now calls the `try_create()` factory method for Objects instead of the `construct()` one.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-27LibSyntax: Teach each highlighter about it's comment syntaxKyle Lanmon
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-12Everywhere: Split Error::from_string_literal and Error::from_string_viewsin-ack
Error::from_string_literal now takes direct char const*s, while Error::from_string_view does what Error::from_string_literal used to do: taking StringViews. This change will remove the need to insert `sv` after error strings when returning string literal errors once StringView(char const*) is removed. No functional changes.
2022-06-10LibGUI: Fix GML parser command order regressionFrHun
This was previously fixed in #13572 with 546d338639cc090055d0c416a76fc237d06930c8 but regressed in #14251 with ec40c93300a2b111129adf1a5badecde8c22889f
2022-06-10LibGUI: Add layout spacer support to GMLFrHun
This is a bit of a hack, but it is an easy way to finally get spacers into GML. This will translate well if spacers are later to become child objects of the continer widget.
2022-05-21LibCodeComprehension: Re-organize code comprehension related codeItamar
This moves all code comprehension-related code to a new library, LibCodeComprehension. This also moves some types related to code comprehension tasks (such as autocomplete, find declaration) out of LibGUI and into LibCodeComprehension.
2022-04-08LibGUI: Stop dropping comments between children and end of GML objectsIdan Horowitz
Any left-over comments in the pending_comments vector are now inserted as sub object children, as these are serialized last and will therefore show up in their expected location.
2022-04-08LibGUI: Insert parsed comments in parsing orderIdan Horowitz
We were accidentally reversing the order of consecutive comments when inserting them as children of the GML object.
2022-04-08LibGUI: Remove left-over spammy debug printIdan Horowitz
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-02-13gml-format+Playground: Print GML parsing error on formatting failureIdan Horowitz
2022-02-13LibGUI: Enforce new GML newline and ordering guidelinesIdan Horowitz
Specifically: * Properties must precede sub-object declarations. * There shouldn't be any newlines in-between properties. * There should be a newline in-between each sub-object. * Object declarations must include the curly braces. * There should be a newline between the properties of an object and it's sub-objects.
2022-02-07LibGUI: Move GML parsing and formatting to new ASTkleines Filmröllchen
This commit introduces a couple of connected changes that are hard to untangle, unfortunately: - Parse GML into the AST instead of JSON - Change the load_from_json API on Widget to load_from_gml_ast - Remove this same API from Core::Object as it isn't used outside of LibGUI and was a workaround for the object registration detection; by verifying the objects we're getting and casting we can remove this constraint. - Format GML by calling the formating APIs on the AST itself; remove GMLFormatter.cpp as it's not needed anymore. After this change, GML formatting already respects comments :^)
2022-02-07LibGUI: Add a custom GML ASTkleines Filmröllchen
This Abstract Syntax Tree is specifically designed to represent GML and also includes comments. It will be used in the next commit to replace JSON in the GML system.
2022-02-07Userland: Undefine FOR_EACH_TOKEN_TYPE everywherekleines Filmröllchen
This was causing some macro redefinition errors after the headers ended up in the same file through some includes. The simple fix is to undefine the macro after use.
2022-02-07LibGUI: Remove GML prefix in favor of proper namespacekleines Filmröllchen
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.