Commit graph

410 commits

Author SHA1 Message Date
Tobias Hunger
2f6be7b31f Mass-add copyright headers into Cargo.toml files 2022-01-19 11:25:21 +01:00
Simon Hausmann
3692710b7b Fix CI and simplify Rust generator API
Return an empty token stream in case the document was empty.
2022-01-13 10:23:57 +01:00
Simon Hausmann
ab6c39f877 Remove unused diagnostics parameter from Rust generator 2022-01-12 16:22:35 +01:00
Simon Hausmann
6acfa53f3e Link to the sixtyfps interpreter crate from the Rust API crate
Our web site and READMEs direct to our Rust API crate, which makes sense as it provides
fundamental traits and types. However as pointed out in
#811 we should advertise the existence of the interpreter API.

Ideally we'd link to the crate documentation that

    (1) perfect matches the version number
    (2) uses sixtyfps.io for our built docs and docs.rs for the published crates

I could not find a way to do this (not without making the crate a dependency and adding features), so
this patch is a compromise that I've seen used in other
crates.
2022-01-11 11:24:18 +01:00
Tobias Hunger
ac8f7b4957 janitor: Sprinkle #[must_use] over the codebase 2022-01-09 13:46:33 +01:00
Olivier Goffart
a751d000db Add a bunch of categories and keywords in some of our Cargo.toml 2022-01-07 17:14:07 +01:00
Simon Hausmann
eb88e77ee9 Some polish to the Rust crate docs
* Improve headings and linkage
* Replace "you can use XXX to YYY" with "Use XXX to YYY"
* In the limitation about exported components, link to the tracking
issue.
2022-01-02 20:19:29 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Simon Hausmann
f08c4dfccb Add a debugging techniques page to the C++ and Rust documentation
This is listed under the reference ("how to") and explains `SIXTYFPS_SLOW_ANIMATIONS`, SIXTYFPS_DEBUG_PERFORMANCE` as well as `SIXTYFPS_SCALE_FACTOR`.

cc #728
2021-12-21 09:09:59 +01:00
Olivier Goffart
8b9be10ff8 Attempt to properly detect if the native style is available when cross compiling
... and using the sixtyfps! macro

The problem is that the OUT_DIR in the build script of the macro crate
is reporting a target directory for the host (since the macro itself is
built for the host), but we need to get the OUT_DIR of the crate, so query
it in the macro. Unfortunatelty, that env variable is only set when the
crate (using the macro) has a build script. So use a fallback to find the
target directory

Fixes #462
2021-12-06 12:59:48 +01:00
Olivier Goffart
0e174b6aba Start working on makeing the generated code no_std 2021-12-01 10:36:29 +01:00
Olivier Goffart
a201c31eaf Don't use Lazy to initialize the ITEM_TREE, use OnceBox instead
Lazy needs std
2021-12-01 10:36:29 +01:00
Olivier Goffart
6b60e832ed Make sixtyfps-rs compile as a no_std crate 2021-11-30 21:33:32 +01:00
Olivier Goffart
6004c4ee2f Make the std feature optional in sixtyfps-rs
And tweak the MCU backend dependencie
2021-11-30 15:48:05 +01:00
ogoffart
3278b39549 Bump version number to 0.1.6 2021-11-24 14:19:09 +00:00
Olivier Goffart
abed31454c Update version number in docs in preparation for the release 2021-11-24 14:10:16 +01:00
Olivier Goffart
d1cae710df preprocess the images at compile time
For the MCU port, we need to proccess the image to save them in the binary
in a convenient format.
This patch start this work by trying to anaylyze what format should an image
be using, and saving it as a texture in the binary.

The current graphical backend and the C++ frontend are not yet supported
2021-11-19 15:54:45 +01:00
Olivier Goffart
d97fe873ec Fix the FieldOffsets derive macro on non pub struct
When the struct expose as public a private type
2021-11-08 19:01:29 +01:00
Simon Hausmann
7d04ba98b1 Document MSRV in the crate README
This way it appears on crates.io

cc #622
2021-11-05 13:54:58 +01:00
Simon Hausmann
a4c5d3d9aa Fix build of bindings in sub-components in Rust
Implement the StrongComponentRef trait for VRcMapped so that the calls to set_property_binding
compile.
2021-11-05 11:29:59 +01:00
Olivier Goffart
3cdd830417 Bump vtable version 2021-11-04 19:57:52 +01:00
Simon Hausmann
67579ec560 Simplify drop implementation of generated components
Avoid creating an intermediate array of items to free the graphics resources.
Instead call run-time function with the item tree as a parameter, which is traversed.

It's practically the same data structure that was previously created, except
that it is shared/global and has little holes for the dynamic tree items, but those are easy to skip.
2021-11-01 08:58:53 +01:00
ogoffart
b25ae6fbcd Bump version number to 0.1.5 2021-10-26 07:36:54 +00:00
Olivier Goffart
d194e18f99 Update the version number in the .md files 2021-10-22 16:09:02 +02:00
Olivier Goffart
794692cbb8 Update version in docs 2021-10-22 16:05:14 +02:00
Olivier Goffart
2f6ebfe38d Fix some docs warning 2021-10-22 14:32:17 +02:00
Simon Hausmann
63bf1af093 Add support for tracking the length of a model in Rust
This is done by exposing the ModelNotify to the caller via the new
ModelTracker trait, which has a function that allows "hooking" into the
dirty tracking of the size.

By extension, this also works in JavaScript.

cc #98
2021-10-20 15:25:28 +02:00
Olivier Goffart
6b55821707 sixtyfps-build: don't print rerun-if-changed before the compilation error
Because otherwise it shows in the output in case of .60 compilation error
2021-10-12 14:05:33 +02:00
Simon Hausmann
2983ae48c4 Remove unnecessary dependency 2021-10-08 10:02:02 +02:00
ogoffart
77fcd5221b Bump version number to 0.1.4 2021-10-07 09:36:43 +00:00
Olivier Goffart
4844450d01 Update the version in docs 2021-10-06 14:54:22 +02:00
Olivier Goffart
106f1b756b Fix sixtyfps-build always forcing a rebuild when a builtin image is include
We can't call return-if-changed with "builtin:" URL, otherwise cargo
thinks the build script always need to be re-run

Fix the gallery example always being rebuilt because it uses AboutSixtyFPS
2021-10-06 12:28:30 +02:00
ogoffart
8b9717633e Bump version number to 0.1.3 2021-10-05 10:31:45 +00:00
Olivier Goffart
bbe178aadf Add links to the template repositories 2021-09-28 08:24:44 +02:00
Olivier Goffart
28932a32a5 Mention the bool type in the docs 2021-09-24 09:26:00 +02:00
Simon Hausmann
043c1932ad Make it possible to disable x11 support
The GL backend defaults to enabling X11. The default crate depends on
the GL backend but it doesn't specify default-features = false,
therefore x11 is basically always enabled.

In line with commit 1fd8c7236a, this
change makes sure that the defaults are defined in the tree entry
points: The Rust API crate, the interpreter crate and the CMake project
define the defaults. The latter already enabled X11 by default, but the
first two did not.
2021-09-22 11:32:51 +02:00
Olivier Goffart
c56b965672 Update version number in docs 2021-09-09 08:54:19 +02:00
ogoffart
e54e03148f Bump version number to 0.1.2 2021-09-04 10:08:51 +02:00
Olivier Goffart
e22e870ce6 Adjustment to the rust documentation with regards to global singetons 2021-08-27 18:00:44 +02:00
Simon Hausmann
4b8259017b Doc fixes
Try to use the term "global singleton" consistently. That's also the
term we use in the language reference.
2021-08-27 13:46:44 +02:00
Simon Hausmann
c7ef3e0fb9 Link from the rust global docs to the singleton langref 2021-08-27 13:36:48 +02:00
Simon Hausmann
28dd54ebad Add docs for the Rust API of accessing globals 2021-08-27 13:36:48 +02:00
Simon Hausmann
7a8c798d70 Fix rust doc build 2021-08-27 13:36:48 +02:00
Simon Hausmann
cf7d33fb5d Add support for accessing exported globals from Rust 2021-08-27 13:36:48 +02:00
Olivier Goffart
071c1ea92f Update version number in README 2021-08-19 10:46:25 +02:00
Olivier Goffart
7c3555e280 Update the version number that shows in the documentation
It does not update the version number in the README because
these are either not part of the versionized documentation
or the demantic versioning make it work anyway
2021-08-19 09:57:13 +02:00
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Olivier Goffart
a094ce7a2a Add a warning on the internal crates documentation that we don't follow semver 2021-08-16 18:26:33 +02:00
Simon Hausmann
1fca971fa8 Rename RGB(A)8Pixel to Rgb(a)8Pixel
That's consistent casing with RgbaColor.
2021-08-10 15:56:01 +02:00
Simon Hausmann
6016007c6f Avoid the need for SharedPixelBuffer users to depend on rgb
Re-export the two typical pixel types, for convenience. Of course other
types can be used, too, if the user depends on rgb directly.
2021-08-10 15:56:01 +02:00