Commit graph

282 commits

Author SHA1 Message Date
Tobias Hunger
8a036ef293 rust: Generate better indices for the parent node of repeaters
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-03-31 14:40:57 +02:00
Olivier Goffart
ad5991f8fa Fix PopupWindow within repeater
* The LLR expect that the popup_window is actually contained in it's parent
   component popup_windows, otherwise the context is not correct.
 * There is no index property for a PopupWindow

Fixes #1113
2022-03-30 16:46:55 +02:00
Tobias Hunger
ee68716d07 Component: Add information to stich together ItemTrees
Add accessors to the information necessary to stitch together the
Component-wide ItemTrees (which include DynamicNodes) into one logical
tree of Items.
2022-03-28 14:13:36 +02:00
Tobias Hunger
0c952ddee7 rust: Simplify item_tree() method by making the tree const 2022-03-21 19:21:57 +01:00
Tobias Hunger
ea684fa4de Add item_tree function to Component VTable 2022-03-14 17:19:31 +01:00
Tobias Hunger
bdc3778cec Rename init/free item functions back 2022-03-14 09:43:50 +01:00
Tobias Hunger
095537e3fd Remove item from ItemTreeNode
... and make ItemTreeNode non-generic this way.

The Item is now only in the extra ItemArray struct and we are free to
expose the ItemTree further.
2022-03-14 09:43:50 +01:00
Tobias Hunger
6681545aca Use item_array in rust 2022-03-14 09:43:50 +01:00
Tobias Hunger
b95342551b Add index into item_array into ItemTreeNode 2022-03-14 09:43:50 +01:00
Simon Hausmann
f1dae75d53 Fix interpreter ffi build
Commit 738ac0dc01 increased the size of the ImageInner::StaticTextures variant,
which breaks the size assertions in the interpreter ffi build.

This changes fixes that by reducing the size of the ImageInner variant again by
moving all the fields into a separate struct.
2022-03-03 14:04:45 +01:00
Simon Hausmann
738ac0dc01 mcu: scale images at compile time (#966)
Apply a scale factor to reduce the size of embedded images at compile
time.
2022-03-03 13:28:47 +01:00
Olivier Goffart
0dc188f328 Support for referring to other globals from globals
- We need to make sure that the initialization of global is in the right order.
 - In C++ and rust, we need to add accessor to the global component
 - There can be `PropertyReference::Global` in binding of globals
 - The interpreter globals need to hold references to the global they may depend on

Fixes #175
2022-02-28 10:14:34 +01:00
Olivier Goffart
c941946f49 Debug: make sure that more properties have debug_name
The global properties, and base properties were not named

This adds a Property::new_named regardless if debug is enabled or not
2022-02-18 17:40:17 +01:00
Olivier Goffart
d70a304e2b fix slint_debug_property cfg build 2022-02-18 12:24:35 +01:00
Olivier Goffart
a32eee64a7 Count the uses of property, and do not generate properties that are not used 2022-02-17 16:25:48 +01:00
Olivier Goffart
85e88eb3d6 Silent warning in the generated code.
Inlining may cause global to become unused.
In a perfect world, We should remove the global completely instead, but
that will be for a followup patch
2022-02-16 18:46:37 +01:00
Olivier Goffart
068a7a51b5 Rust generator: Fix type conversion when creating a Point
Before it used to always be a property access, but now it may be inlined
and result in a f64 or int expression
2022-02-16 18:46:37 +01:00
Olivier Goffart
9f77e9a2e8 llr: note when a property binding is for a StateInfo 2022-02-16 18:46:37 +01:00
Olivier Goffart
9e938046ca llr: Add a helper function 2022-02-16 18:46:37 +01:00
Olivier Goffart
76a1bf8d7d LLR: Put the expression into a RefCell so they can be optimized 2022-02-16 18:46:37 +01:00
Simon Hausmann
304e06f758 Begin rasterizing glyphs for glyph embedding
Enable with `SLINT_EMBED_GLYPHS=1` and select sizes like
`SLINT_FONT_SIZES=12,16`

This change just puts the data structures in place, rasterizes a fixed
subset, embeds that into the rust generated code and calls a backend
function for registering the font that is unimplemented.
2022-02-15 15:52:24 +01:00
Simon Hausmann
29cbb9e181 Change names of identifiers used for accessing embedded resources in the compiler
Instead of using SFPS (Slint_Fast_Packing_System) use SLINT :-)
2022-02-14 16:17:55 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Olivier Goffart
f0b047057b Fix HighDPI on windows with the rust generator and the native style and qt backend
We must create the window first to initialize the backend before
the style is called because it would initialize qt as a plugin instead
of as a proper application, and it would then not initialize the high dpi mode
2022-02-09 09:47:39 +01:00
Olivier Goffart
91e107150e Merge remote-tracking branch 'origin/wip/rename'
Conflicts:
	examples/opengl_underlay/index.html
	examples/opengl_underlay/main.cpp
2022-02-08 07:29:41 +01:00
Olivier Goffart
0dba666d1f Rust generator: Fix compilation returning from void callbacks
If a callback returning voids ends in a statement that returns something,
we would have an error in the rust generated code as we end our function
with an expression that is not `()`
2022-02-06 10:33:36 +01:00
Tobias Hunger
cc3994b58d
Rename rust API 2022-02-02 13:26:35 +01:00
Simon Hausmann
7d297da2fc Rename the sixtyfps C++ namespaces 2022-02-02 12:11:27 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Tobias Hunger
0d358251c9 Janitor: More clippy stuff 2022-01-31 20:59:45 +01:00
Tobias Hunger
cc568a63f5 Janitor: Fix stray @ in patterns 2022-01-31 20:59:45 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_compiler/generator/rust.rs (Browse further)