Commit graph

632 commits

Author SHA1 Message Date
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
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
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
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
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
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
ffe561f8d8 Use SharedVector internally in SharedString
Get rid of the triomphe dependency
2021-12-02 12:42:30 +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
Simon Hausmann
a244e16829 Add visiblity to the C++ binary packages
* Rename the package to `SixtyFPS-cpp-*` to make it easier to see that these are for C++
* Refer to the download and extraction process in the two C++ "READMEs"
* Set the home page url in the cmake project() command, from where cpack will pick it up for inclusion in the installer.

cc #631
2021-11-24 12:53:43 +01:00
Simon Hausmann
3550362f0b Fix blurry test in the NSIS installer for the C++ package on Windows
Enable High-DPI as per https://gitlab.kitware.com/cmake/cmake/-/issues/17724
2021-11-23 10:18:50 +01:00
Simon Hausmann
cd9db61545 Include the VS runtime dlls in the binary package
We bundle Qt and Qt needs the VC runtime DLLs. There are two options:
Find and locate vcredist.exe, include it in the NSIS installer and run
it. Alternatively, a cmake module exists to locates the DLLs and
install them.

This patch uses the latter option, for simplicity. When upstream ticket
https://gitlab.kitware.com/cmake/cmake/-/issues/17725 is implemented, we
could switch to the first option.

Note: This might include a few DLLs that Qt probably doesn't
need.
2021-11-22 16:04:09 +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
Simon Hausmann
8f940a446e Make it possible to opt out of the default rendering backend selection
The default backend does not select any features or backends by default
on the Cargo.toml feature level. And with this change it also doesn't do
that anymore based on the target platform.

That means if the rust api crate is built with default-features = false,
no backend will be selected and the user has to take care of backend
initialization through other means.

The feature defaults, generally, are in the rust API crate, the
interpreter crate and C++ CMakeLists.txt. The latter triggers a cargo
build of sixtyfps-cpp with --no-default-features. However the cpp_test
job in the CI doesn't build sixtyfps-cpp with CMake but instead calls
cargo directly. Therefore the defaults are now also coded in the
sixtyfps-cpp Cargo.toml, to ensure that *a* rendering backend is chosen
(since the cfg.target bit is gone).
2021-11-19 15:02:52 +01:00
Olivier Goffart
921f5675d6 Put the licenses in the C++ binary package
Note that this also change the path names to "licenses" in the viewer package
2021-11-18 19:20:25 +01:00
Simon Hausmann
7f61d99734 Fix C++ examples not launching out of the box on Windows when using multi-config generator
We copy the sixtyfps_cpp.dll into the bin directory where the examples
are, but that needs to be a Debug/ or Release/ sub-directory in case of
a multi-config generator.
2021-11-18 11:40:45 +01:00
Olivier Goffart
7c34e7f27f C++ packages: Move the Qt plugins in the right directory 2021-11-18 10:23:06 +01:00
Olivier Goffart
6cfb18b5d7 Fix warnings in the tests in release
The maybe-uninitialized warning triggers while we know from what
we are testing that it is meant to be initialized
2021-11-18 10:23:06 +01:00
Olivier Goffart
304ca3b62f C++ package: Bundle the Qt binary in the binary package 2021-11-18 10:23:06 +01:00
Olivier Goffart
44118556c3 cpack: Only generate one package (the tar.gz one) 2021-11-18 10:23:06 +01:00
Olivier Goffart
238ae33fe6 Remove a presumably useless file
We have no memory of why this file is needed. Let's remove it
2021-11-16 18:01:28 +01:00
Olivier Goffart
7bf3fd2871 Fix invalid CMake package on windows because of missing IMPORTED_IMPLIB 2021-11-16 17:06:27 +01:00
Olivier Goffart
8a3b064b58 cmake: have the style as a cmake cache variable 2021-11-16 17:06:15 +01:00
Simon Hausmann
6346a55fdd Check the Rust version when using corrosion
Let cmake perform the version check. FindRust.cmake already uses VERSION_VAR
and therefore is versioned.

cc #622
2021-11-05 13:07:36 +01:00
Simon Hausmann
4800217f2f Document the minimum supported Rust version
cc #622
2021-11-03 16:39:41 +01:00
Marat Nagayev
573588d634 Update cmake.md 2021-11-03 12:08:02 +01:00
Olivier Goffart
789ac719eb Make the parent_item function work with repeater component 2021-11-01 16:11:38 +01:00
Olivier Goffart
d26e95fb95 C++: Fixed sixtyfps::blocking_invoke_from_main_loop when the callable returns void
Fixes #623
2021-11-01 10:51:13 +01:00
Simon Hausmann
096fbab93d Simplify the destructor of generated C++ components
Similar to the parent commit, avoid creating an array of item refs and pass the item tree instead
to a run-time helper function.
2021-11-01 10:19:17 +01:00
Olivier Goffart
567c644a5f Fix PopupWindow position when all elements are not inlined
Pass a reference to the parent item in the show_popup function
so we can compute the exact location at runtime.
2021-10-28 15:52:29 +02:00
ogoffart
b25ae6fbcd Bump version number to 0.1.5 2021-10-26 07:36:54 +00:00