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
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
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
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
cf7d33fb5d
Add support for accessing exported globals from Rust
2021-08-27 13:36:48 +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
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
Simon Hausmann
f25f85844d
Remove SharedImageBuffer from the public Rust API
...
and instead fold the constructor functions into Image as `new_rgb8`/`new_rgba8` and `new_rgba8_premultiplied`.
2021-08-10 15:56:01 +02:00
Simon Hausmann
8a3a68a4fa
Add API to Rust sixtyfps::Image to enable creation from user supplied image buffers
...
This adds an ImageBuffer and PixelBuffer type for SharedVector
backed images. The documentation explains how to use this
with low-level rendering functions and the popular image crate.
Fixes #387
2021-08-10 15:56:01 +02:00
ogoffart
53f286258c
Bump version number to 0.1.1
2021-08-10 08:06:20 +00:00
Tobias Hunger
2606d6d9e7
Janitor: Fix clippy::clone_on_copy
2021-08-04 22:50:35 +02:00
Tobias Hunger
ce976a1dbb
Janitor: Fix clippy::useless_conversion
2021-08-04 22:50:35 +02:00
Tobias Hunger
24a2021226
Janitor: Fix clippy::needless_borrow
2021-08-04 22:50:35 +02:00
Olivier Goffart
603c5df47a
Building the doc no longer need nightly rust
...
Rust 1.54 has the feature that allow us to include markdown files
in the docs
2021-08-03 16:27:31 +02:00
Simon Hausmann
29f5853332
Provide sixtyfps::Window
by reference in the Rust API
...
This also removes Clone from the Window again, to avoid having to face
the question: Does cloning a window duplicate it on the screen?
2021-08-03 10:32:04 +02:00
Simon Hausmann
66891a299c
Start a new sixtyfps::Window API for Rust, C++, the interpreters and JS
...
The generated component now provides access to a Window type
via the window() accessor function.
This is part of #333
2021-08-03 10:32:04 +02:00
Simon Hausmann
cb76186b59
Remove stray line
2021-08-01 09:34:36 +02:00
Simon Hausmann
52aee8d366
Another minor reduction in generated code
...
Further build on b3529d1b75
and move the
strong/weak reference dance into the API crate out of the generated
code.
Saves ~21k llvm lines on the printer demo (debug).
It's also possible to move the as_pin_ref() bit, but that didn't
really give any savings overall.
2021-08-01 09:34:36 +02:00
Simon Hausmann
b3529d1b75
Rust: Speed up compilation times of generated code
...
The binding setup functions (set_binding, set_animated_binding, etc.)
are taking the binding basically as an `impl Fn() -> T`, which means
each call site creates a new copy. The bodies of these can be quite big.
Since most of our uses follow the pattern of just capturing the
samereduce the number of copies needed parameter, we can reduce the
number of copies needed by providing wrappers.
With rustc 1.54.0 on my mbp and debug, the build time of
touch ../ui/printerdemo.60
cargo rustc
goes from 1m:15s down to 42s, and total llvm lines goes from
2079842 down to 1134237.
2021-07-30 09:22:20 +02:00
Olivier Goffart
fae6e0b52d
Document that angles are represented in degrees at run-time
2021-07-26 17:36:02 +02:00
Tobias Hunger
27b42687fa
Janitor: Fix clippy::redundant_closure
2021-07-23 13:48:52 +02:00
Simon Hausmann
3146fb7764
internal cleanup: Remove the sixtyfps::testing::HasWindow trait
...
and replace it with the internal, re-exported WindowHandleAccess
one.
Strictly speaking, this is a breaking change. In practice the
returned type of this trait was in `sixtyfps::re_exports`, so any
public use is questionable :)
2021-07-21 20:33:02 +02:00
Simon Hausmann
eaddbe664e
internal cleanup: Rename ComponentWindow to WindowRc
...
That's all it is nowadays, it's a wrapper around Rc<Window>. It's not an
alias because we need to also "wrap" it to C++ via cbindgen, but that's
about it.
2021-07-21 20:33:02 +02:00
Simon Hausmann
1c285694d7
internal cleanup: Remove the use of ComponentWindow in the interpreter
2021-07-21 17:41:12 +02:00
Simon Hausmann
ef184f7f1a
internal cleanup: Remove the rest of the ComponentWindow API
...
Now it just remains a wrapper around the Rc, and it can soon be moved to
the API crate hopefully.
2021-07-21 17:41:12 +02:00
Simon Hausmann
e005058285
internal cleanup: remove free_graphics_resource from the public ComponentWindow API
...
Use the WindowHandleAccess backdoor instead.
2021-07-21 17:41:12 +02:00
Olivier Goffart
3078285114
Add sixtyfps::Weak::upgrade_in_event_loop
2021-07-19 15:57:29 +02:00
Olivier Goffart
b3e58d58fe
Add a note in the doc that recomands resolver = "2"
2021-07-16 17:32:08 +02:00
Olivier Goffart
13bd828b96
Update license date
2021-07-02 15:55:54 +02:00
Olivier Goffart
423656d900
Update some more version number
...
Meaning that following the docs or tutorial won't work until the release is complete
2021-06-30 17:21:38 +02:00
Simon Hausmann
5d58d34e84
Document run_event_loop() and quit_event_loop()
...
The C++ versions were there before, but undocumented. The Rust version
for quit() was missing.
2021-06-29 16:12:00 +02:00
Olivier Goffart
16ba23ae47
Move StateInfo to the private namespace
2021-06-28 11:23:44 +02:00
Olivier Goffart
98cec35080
Increase version numbers
2021-06-28 10:39:43 +02:00
Tobias Hunger
13d7f5e7bd
Janitor: Fix typos in comments and user-facing strings
...
Also adapt tests for error messages containing the fixed strings.
No behavior change is intended!
2021-06-28 08:32:25 +02:00
Simon Hausmann
54c8c7761b
Refer to the tutorial from our front-pages that also refer to the reference docs
2021-06-17 16:38:19 +02:00
Simon Hausmann
7ebbf20467
Fix doc build with nightly in CI
...
The #[doc = include_str!("...")] syntax is now the new external file
syntax in rust nightly - the old syntax was removed.
2021-06-06 20:52:10 +02:00
Olivier Goffart
142a8dc185
Rename ImageReference to ImageInner and make Immage.0 private
2021-05-28 17:05:16 +02:00
Olivier Goffart
8e44ac2351
Image type: some more docs
2021-05-28 17:05:16 +02:00
Olivier Goffart
0b3fecf300
WIP: API to expose image loading from C++ and Rust
2021-05-28 17:05:16 +02:00