Commit graph

613 commits

Author SHA1 Message Date
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
Olivier Goffart
ce65e7871c Update the GIT_TAG in the readme 2021-10-22 16:51:25 +02:00
Simon Hausmann
d420d5efd7 internal cleanup: Rename Property::set_dirty() to mark_dirty() 2021-10-20 15:25:28 +02:00
Simon Hausmann
7d12fd7b4e Add support for tracking the length of a model in C++
Similar to the parent commit, the model tracks changes to the rows and
marks an internal property dirty. Since we have a base class this is a
little less intrusive.

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
Simon Hausmann
c91a38cdce Add support for embedding data in generated C++ code
This allows compiling with SIXTYFPS_EMBED_RESOURCES=true and
images/fonts are embedded as inline variables.

Generated data is emitted into the header file as

   inline uint8_t sfps_embedded_resources_123[789] = {
       0x1, 0x2, 0x3,
   };
2021-10-05 15:05:50 +02:00
ogoffart
8b9717633e Bump version number to 0.1.3 2021-10-05 10:31:45 +00:00
Olivier Goffart
ae3e1b4680 Allow normal Element to be in the Dialog's button row with dialog-button-role 2021-10-05 09:46:20 +02:00
Olivier Goffart
2716e4b4dd TouchArea: add the pointer-event callback
... instead of `pressed-changed`

This allows to see what mouse button was pressed.

Closes #535
2021-10-04 14:39:49 +02:00
Simon Hausmann
7a2f365941 Bump corrosion sha1
This includes improved cargo version parsing and better error messages when rustc isn't found.
2021-09-30 15:03:40 +02:00
Olivier Goffart
671df0f24f New widget: StandardButton 2021-09-29 16:25:44 +02:00
Simon Hausmann
4eef8c7688 Add API to sixtyfps::Image in Rust and C++ to access the optional path 2021-09-28 08:52:27 +02: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
45aa93f1b1 Make it possible to use the C++ build with Qt 6
Since we require Qt 5.15, we can use the versionless CMake targets and also
find Qt 6 first.
2021-09-20 17:02:35 +02:00
Simon Hausmann
324fb48499 Clean up generated C++ include directory handling
Don't generate the headers by default in the source directory, put them
into a sub-directory in OUT_DIR instead and convey that location via
links to the C++ test driver.
2021-09-18 07:32:53 +02:00
Simon Hausmann
4f158618a1 Fix make install in the C++ build running cbindgen
Make install would still trigger the generated_headers_target CMake
custom command - due to the use of add_dependencies - and that would end
up running cbindgen. That in turn breaks "make install" when it's run in
an environment that doesn't have cargo in PATH (for example when using
"sudo make install").

This patch folds the generation of the C++ header files into the build
of the sixtyfps-cpp crate - via build.rs. By default the headers are
placed in api/sixtyfps-cpp/generated_include but the CMake build
redirects that into the build directory.

Note: Due to the way that corrosion works, cargo is still run when
running "make install", but it's path is absolute and there should not
be any reliance on the PATH environment variable.
2021-09-18 07:32:53 +02:00
Simon Hausmann
562842f19e Bump minimum required CMake version from 3.16 to 3.19
The upcoming re-organization of the C++ header generation requires the
use of the CORROSION_ENVIRONMENT_VARIABLES target property, which in
turn requires CMake >= 3.19.
2021-09-18 07:32:53 +02:00
Simon Hausmann
0e191caf78 Improve cmake diagnostics
Print a feature summary. This also helps diagnose CI builds.
2021-09-16 10:41:33 +02:00