Commit graph

383 commits

Author SHA1 Message Date
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
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
4c7ecc57d8 Janitor: Fix clippy::or_fun_call 2021-08-04 22:50:35 +02: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
f38ce3c090 Fix the tests 2021-07-29 18:25:23 +02:00
Olivier Goffart
188806ef89 An empty sixtyfps! macro should compile 2021-07-29 17:50:57 +02:00
Olivier Goffart
c11d880424 Rerun the build scripts that compile .60 if the default style might have changed 2021-07-28 16:57:09 +02:00
Olivier Goffart
43e07320a5 Fix comments and naming found in review in #355 2021-07-28 16:57:09 +02:00
Olivier Goffart
7821926002 Rust: defaults to the native style when Qt is available
This requires some gymnastics to get right as the information
need to be passed to the compiler despite having no direct dependency
between the compiler and the runtime or backends.
So use a file in the build directory to tell the default style

cc: #83
2021-07-28 16:57:09 +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