Commit graph

1105 commits

Author SHA1 Message Date
Olivier Goffart
a91e298866 Update corrosion 2022-01-20 09:41:45 +01:00
Olivier Goffart
abdcc77650 Update corrosion 2022-01-20 07:52:19 +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
2f6be7b31f Mass-add copyright headers into Cargo.toml files 2022-01-19 11:25:21 +01:00
Olivier Goffart
f9f90e1b4e C++: Do not expose private types in the sixtyfps namespace 2022-01-19 11:19:47 +01:00
Olivier Goffart
99adc25a81 llr-cpp: Fix for within layout 2022-01-19 10:02:23 +01:00
Olivier Goffart
d62b788829 C++: Do wrapper to the layout function
That returns and take their argument in a C++-like way instead of by pointer.
2022-01-19 10:02:23 +01:00
Simon Hausmann
6e3fcd1b08 Add row data tracking to C++ sixtyfps::Model
This works the same way as in the Rust model notify.
2022-01-14 13:38:25 +01:00
Simon Hausmann
43830ccd78 Add insert to C++ VecModel 2022-01-14 13:38:25 +01:00
Olivier Goffart
3e264fc7f6 C++: Add new generated files to the list of installed headers 2022-01-13 14:05:23 +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
44297bad24 Fix build of generated Rust code for path elements with the llr
* Move the C++ elements back into private_api (despite being generated), so that struct_name_to_tokens can generate the right name in re_exports
* When generating the llr_Expression::Struct for the path elements, make sure
  that all fields are filled out, to avoid an empty value expression in Expression::Struct
  in the Rust generator. Since we don't generate tuples but a named struct, we must provide all fields.
2022-01-12 16:22:35 +01:00
Simon Hausmann
31471fcf89 Complete path support in the llr / rust generator
This patch takes care of the lowering of events/coordinates arrays as
path data, which originates from a `commands: ...` string of SVG path
commands.

In order to minimize the path specific code in the generator, the
compile_paths now generates a Vec<Expression> for the events and
coordinates.
2022-01-12 16:22:35 +01:00
Simon Hausmann
9e61d4168b Fix build of Paths with path elements with rust/llr
A `Path` with `MoveTo`/`LineTo`/etc. sub-elements now maps to an Expression::PathData of type
Type::PathData.

The llr lowering creates an Array of Type::PathElement, which is casted to PathData.

This only covers the element case. The compiled path events are still todo.
2022-01-12 16:22:35 +01:00
Tobias Hunger
7bba5c4e31 janitor: Fix warning when building C++ tooling
Replace `std::array::IntoIter::new(...)` with
`IntoIterator::into_iter(...)` as suggested by the compiler.
2022-01-12 12:31:15 +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
Tobias Hunger
79e2456ead Allow for bigger indices in VisitChildrenResult
The indexes stored in `VisitChildrenResult` are unsigned. We have 64
bits to store two values and we need to have one special value as a flag.

So accept any index `< u32::MAX` instead of `< i32::MAX`, which should
allow for more data to be visited;-)
2022-01-08 20:55:22 +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
aadb755fd7 Join separated documentation for some interpreter C++ API types
The docs were living in the public header file while the enums/structs were defined in Rust.
With the infrastructure of the parent commits we can join them together.
2022-01-05 16:32:55 +01:00
Simon Hausmann
dc387553ba Centralize the C++ sixtyfps version macros in the generated public header file 2022-01-05 16:32:55 +01:00
Simon Hausmann
174fd2659f Remove some duplication in the documentation of API that's shared between Rust and C++
This change makes the start of sharing the docs for the `TimerMode` enum
between Rust and C++. The reference to Timer::start in there works as
both doxygen and rustdoc find the right reference, but this needs
careful editing in the future and double-checking!

Another "caveat" is that the docs for the TimerMode enum say that the
enum is defined in the file "sixtyfps_generated_public.h", which is
correct as-is but not as pretty as "sixtyfps.h". I tried various ways
with \file and \includedoc, but couldn't get it working differently.

To implement this, the cppdocs steps now also runs cbindgen and cbindgen
generates a new sixtyfps_generated_public.h file that contains types we
do want to have in the public sixtyfps namespace.
2022-01-05 16:32:55 +01:00
Simon Hausmann
083ae5692b Fix the Rust/C++ Timer API to be more convenient to use
Allow calling restart() on a repeated timer if it has been previously stopped.
2022-01-05 13:26:28 +01:00
Simon Hausmann
f557a27556 Complete the C++ Timer API
With this patch it matches the Rust API, with start(), restart(), running() and
a default constructor.
2022-01-05 12:10:29 +01:00
Tobias Hunger
2b222457ef
janitor: Remove some unnecessary to_string() calls 2022-01-04 18:23:02 +01:00
Tobias Hunger
6d69c343dc
Revert "Deduplicate use of ptr_eq for Models"
This was not intended to get uploaded without review!

This reverts commit d678f4b1da.
2022-01-03 17:10:27 +01:00
Tobias Hunger
d678f4b1da
Deduplicate use of ptr_eq for Models 2022-01-03 16:22:32 +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
597467fae9 Manually update license information in Cargo.toml files
... that are not published or private or not processed by xtask for
other reasons.
2021-12-22 10:06:12 +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
Simon Hausmann
774be9ba76 Improve timer docs
Use the term interval instead of duration to emphasize that it's not a single shot.

(The single-shot docs still use duration)
2021-12-12 09:29:16 +01:00
Lukas Jung
f0a47ff154 Add mouse-cursor property to TouchArea 2021-12-07 22:41:24 +01:00
Olivier Goffart
310bf897cd Native ComboBox: style the background of the popup
Fixes: #720
2021-12-06 18:52:10 +01:00
Olivier Goffart
53775465dc
C++: add version macro
Fixes #705
2021-12-06 15:36:16 +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
ffe561f8d8 Use SharedVector internally in SharedString
Get rid of the triomphe dependency
2021-12-02 12:42:30 +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
Olivier Goffart
e4bd6bbfb8 Native style: respond to the StyleChange event
So that color scheme is updated when switching to the dark style, for example

Fixes #687
2021-11-29 17:18:23 +01:00
Olivier Goffart
c15a59892a C++: use the const version of begin and end from SharedVector::clear 2021-11-26 15:12:21 +01:00
Olivier Goffart
d9637816bb Fix memory leak in the C++ SharedVector
detaching in the destructor is not a good idea, make sure to use the const version
2021-11-26 15:02:46 +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
Simon Hausmann
78753cd3aa Include the architecture in the file name for non-Windows
On windows that's already included, but on Linux it should also be
there.
2021-11-24 13:45:52 +01:00
Simon Hausmann
42477db3e3 In the C++ prerequisites, link to the cmake website
It's easier that way :-)
2021-11-24 13:02:08 +01:00