Commit graph

5475 commits

Author SHA1 Message Date
Olivier Goffart
f94e03bf4e The mcu backend is not ready to be published yet 2022-01-20 10:47:48 +01:00
Olivier Goffart
1e9e252400 Fluent style: uniformize the height of widgets
Make sure they all have the minimum height based on what is currently
the hardcoded value of the button.
Also inlclude the border top and bottom padding in the layout in case the
font is really big
2022-01-20 10:41:14 +01:00
Simon Hausmann
3d5fbc76fe Prospective fix for the printer demo not loading in the online editor
Commit fa1ac9884d introduced an early check for the existence
of the specified font files. However we should only do that for local files for now.
2022-01-20 10:37:29 +01:00
Olivier Goffart
a91e298866 Update corrosion 2022-01-20 09:41:45 +01:00
Olivier Goffart
1db34682ee C++: fix crash when closing window
the m_window needs to be destroyed after the destructor of the repeater
2022-01-20 08:42:32 +01:00
Olivier Goffart
abdcc77650 Update corrosion 2022-01-20 07:52:19 +01:00
Simon Hausmann
e2838a87ab Fix missing calls to init() of native items in repeater item trees when using C++
Like in the Rust generator, we need to always call init_items().
2022-01-19 16:56:02 +01:00
Simon Hausmann
fa1ac9884d Verify the existence of imported custom fonts
... and produce diagnostics.

That way in later phases we don't need to check again.

As an unfortunately side-effect, we need to skip one of the examples in
the language reference from the doc test, as the compilation fails
because the font does not exist.
2022-01-19 16:24:22 +01:00
Simon Hausmann
1bacaee68b Fix stack usage on Windows with Rust debug builds
Re-apply commit f7248a4863 to the updated code generator.

This fixes running the gallery on Windows in debug builds with the fluent style.
2022-01-19 16:22:03 +01:00
Simon Hausmann
9bbcf16124 Fix typo
Co-authored-by: Olivier Goffart <ogoffart@sixtyfps.io>
2022-01-19 15:42:43 +01:00
Simon Hausmann
1fcfc58975 cpp generator: reduce surface of public C++ API
Use Access::Private as access for properties, items, helper fields (tree
index, etc.), and vtable functions of the public component.

All meanwhile added declarations for sub-components (such as popups, child repeaters)
still get access through friendship.
2022-01-19 15:42:43 +01:00
Simon Hausmann
5bbc25fa82 Bump dependencies for the GL backend
Use newer resvg/usvg, femtovg and ttf-parser.
2022-01-19 15:35:21 +01:00
Tobias Hunger
68b4d4065b Keep LICENSE.md file but install LICENSES folder 2022-01-19 11:25:21 +01:00
Tobias Hunger
0fc176a408 Document some licenses in a REUSE compliant way 2022-01-19 11:25:21 +01:00
Tobias Hunger
a8853dcff5 reuse: Grep for old license info and replace it 2022-01-19 11:25:21 +01:00
Tobias Hunger
a2da193d07 xtask: Obfuscate SPDX tags in xtask code
... to stop the reuse tool from getting confused.
2022-01-19 11:25:21 +01:00
Tobias Hunger
a55f4a1bb5 xtask: Ignore *.license files
REUSE uses those files to attach license information to files that can
not get changed themselves (e.g. images, fonts and similar files).
2022-01-19 11:25:21 +01:00
Tobias Hunger
e62ab8227e Use REUSE-compatible layout of license information
Replace the LICENSE.md file with files in the LICENSES folder.
2022-01-19 11:25:21 +01:00
Tobias Hunger
2f6be7b31f Mass-add copyright headers into Cargo.toml files 2022-01-19 11:25:21 +01:00
Tobias Hunger
c22f3322ca xtask: Add copyright headers to CARGO.toml files as well 2022-01-19 11:25:21 +01:00
Tobias Hunger
ecf6ac4558 Replace image in gallery examples
The license of the thumbsup emoji from apple is unclear, so use the
google one, which is Apache-2.0 licensed.

Add a .license file to document this.
2022-01-19 11:25:21 +01:00
Olivier Goffart
c9bba12b0f cmake: Don't warn when Qt5 is found but not Qt6 2022-01-19 11:22:07 +01:00
Olivier Goffart
f9f90e1b4e C++: Do not expose private types in the sixtyfps namespace 2022-01-19 11:19:47 +01:00
Simon Hausmann
be83d60bd8 Simplify signature of compiler code generator
Remove the unused diagnostics parameter.
2022-01-19 10:02:23 +01:00
Simon Hausmann
12e2aa3941 cpp llr: Simplify generate() signature
Since the function always returns Some(), we can remove the Option from the return type.
2022-01-19 10:02:23 +01:00
Tobias Hunger
81d1c8129f Remove some commented out code 2022-01-19 10:02:23 +01:00
Tobias Hunger
fb3d5ef263 LLR-C++: Implement ShowPopupWindow 2022-01-19 10:02:23 +01:00
Tobias Hunger
638326cb39 Remove useless comment 2022-01-19 10:02:23 +01:00
Simon Hausmann
96a5682fd8 cpp llr: remove some old code that was commented out 2022-01-19 10:02:23 +01:00
Simon Hausmann
3ec6c0fc63 cpp llr: fix disappearing items when rendering repeaters
Creating a repeater component would use the same setup code as a public component,
which replaces the component rc in the window among other things.

Handle this in generate_item_tree just like in the Rust generator.
2022-01-19 10:02:23 +01:00
Olivier Goffart
67c6a352ea llr-cpp: fix a warning in the generated code 2022-01-19 10:02:23 +01:00
Simon Hausmann
569fee695e cpp llr: fix use of properties of native items in if conditionals
InNative assumed that the current sub-compo is accessed using "this",
which happens to also be part of regular binding captures. But it isn't for model binding,
for example.

Let's use "self" throughout, like everywhere else.
2022-01-19 10:02:23 +01:00
Simon Hausmann
5e5622a947 cpp llr: Implement RegisterCustomFontByMemory and RegisterCustomFontByPath 2022-01-19 10:02:23 +01:00
Simon Hausmann
4a89cc106c llr cpp: fix initial_focus test
Don't call set_focus_item() followed by set_component() on the window, which clears the focus item again.

Like in Rust, call set_component first, then init_items() and finally all the init/setup code.
2022-01-19 10:02:23 +01:00
Simon Hausmann
5631098f91 cpp llr: invoke generated sub-component init code
The initial focus handling generates setup code, which needs inclusion.
2022-01-19 10:02:23 +01:00
Simon Hausmann
f451e4eaf7 cpp llr: fix set_focus_item builtin method calls
End the function call with a semicolon.
2022-01-19 10:02:23 +01:00
Simon Hausmann
c58668a600 cpp llr: fix test_cpp_7gui_timer
Port commit 242dfcf7cf to catch all conversions from numbers to string.
2022-01-19 10:02:23 +01:00
Simon Hausmann
85fa56ac32 cpp llr: minor cleanup
Fold unused variables into their use-site
2022-01-19 10:02:23 +01:00
Simon Hausmann
f691d91c06 Fix failing rust test
The Close{} element now has a C++ type name, but in the Rust generator we're
not interesting in using that
since PathElement::Close is without fields.
2022-01-19 10:02:23 +01:00
Olivier Goffart
1f3620acfa llr-cpp: fix crash computing path
The events and point were referencing temporaries.
Fix that by passing them as argument to the lambda so the temporaries
don't get destroyed before being used.
2022-01-19 10:02:23 +01:00
Olivier Goffart
35cb9ed338 llr-cpp: Fix Dialog 2022-01-19 10:02:23 +01:00
Olivier Goffart
0259c0dc9b Give a return type to llr::Expression::ExtraBuiltinFunctionCall
Some code in the C++ generator needs the type of such expressions
2022-01-19 10:02:23 +01:00
Simon Hausmann
c2ae82c74f cpp llr: fix crashes_issue_422_enclosing_component
Make sub-compo fields public
2022-01-19 10:02:23 +01:00
Simon Hausmann
80768fd011 cpp llr: fix color and string builtin function calls 2022-01-19 10:02:23 +01:00
Simon Hausmann
44857ff0f2 cpp llr: Fix BuiltinFunction::Debug to stream into std::cout 2022-01-19 10:02:23 +01:00
Olivier Goffart
83136f5bca llr-cpp: fix test_cpp_properties_property_animation 2022-01-19 10:02:23 +01:00
Simon Hausmann
4a3678fe55 cpp llr: Fix support for the Close {} path element 2022-01-19 10:02:23 +01:00
Olivier Goffart
270d8ab2c7 llr-cpp: Transitions 2022-01-19 10:02:23 +01:00
Simon Hausmann
708c4a55de cpp llr: add support for path events 2022-01-19 10:02:23 +01:00
Simon Hausmann
7e695ae4e6 cpp llr: add support for path elements
This is mostly covered by the cast produced by the llr lowering.
2022-01-19 10:02:23 +01:00