Commit graph

597 commits

Author SHA1 Message Date
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
Simon Hausmann
fa294c9b02 Fix C++ warning about unused variable
The insert_it variable is unused, and some compilers warn about it, causing -Werror builds to fail.
2021-09-15 12:59:17 +02:00
Simon Hausmann
c3d0fd04af Add C++ API to introspect exported global singletons in the interpreter
This adds the necessary shims to expose the same API as Rust.
2021-09-15 07:56:28 +02:00
Olivier Goffart
c56b965672 Update version number in docs 2021-09-09 08:54:19 +02:00
Simon Hausmann
e193792194 Update copy of the SixtyFPS logo
Unfortunately the rtd theme doesn't support the logo url yet in
our setup, so update this svg copy as the original was updated to
remove the space between "Sixty" and "FPS".
2021-09-08 17:31:47 +02:00
Simon Hausmann
1fd8c7236a Make it possible to disable the GL backend in the CMake build
Even if SIXTYFPS_BACKEND_GL is set to OFF, we would default to enabling
X11, which translates to enabling the x11 feature, which in turn
implicitly activates the GL backend. In addition, the interpreter Rust
API crate also enables the GL backend in its defeaults.

In order to make it possible to turn off the GL backend, three changes are necessary:

* The default backend no more selects a default :-). Instead the Rust
  API crate, Rust interpreter API crate and the CMake project define
  the same features and defaults.
* The C++ crate depends on the interpreter without its defaults (which enable GL)
* In CMake the X11 and Wayland features become dependent options, that
  are only show in the CMake configure UI if the GL backend is enabled.
  This way a GL-disabled build won't also pass --features x11.
2021-09-08 17:13:10 +02:00
Olivier Goffart
fafcbfde2c Fix panic when trying to access layout cache of destroyed items
This can be reproduced by deleting the last item of the printer queue in the
printer demo.
It is a regression showing up because we now emit the MouseExit event after
the mouse grab as released.
The problem is that we upgrade the weak item, and call geometry() on it.
Calling geometry will re-evaluate the layout cache which will re-evaluate
the model which will result in the component being removed and the cache
entry having less item than expected.

It is ok to simply return 0. for these layout location since the item will
disapear anyway.
2021-09-08 14:42:08 +02:00
Olivier Goffart
619ce6c4f7 Struct exposed to .60 as struct need to be layed out in alphabetical order
because that's the order in which the C++ code generator pass the argument
to the agregate initialization
2021-09-05 09:29:00 +02:00
ogoffart
e54e03148f Bump version number to 0.1.2 2021-09-04 10:08:51 +02:00
Simon Hausmann
cca2a18edb Fix C++ build with the interpreter disabled 2021-09-03 14:33:55 +02:00
Simon Hausmann
5a81976f3b Allow selecting features in the CMake integration
Provide the same features as in the Rust API crate, as CMake
options.
2021-09-03 14:33:55 +02:00
Olivier Goffart
092d5d551f C++: add blocking_invoke_from_event_loop
A blocking version of invoke_from_event_loop
2021-09-01 23:19:13 +02:00
Olivier Goffart
e1be599bc0 Print an warning in stderr when modifying read-only model
... and improve the documentation of Model
2021-08-31 10:36:22 +02:00
Simon Hausmann
54182ff54b Add a section to the C++ intepreter intro about global singletons
Also minor fixes to the generated C++ global singleton docs.
2021-08-27 17:14:57 +02:00
Simon Hausmann
3212cda271 Add a section to the C++ docs about accessing global singletons 2021-08-27 17:08:57 +02:00
Simon Hausmann
8de3075270 C++ docs: rework the entry points
Move the sixtyfps::namespace entry into a dedicated C++ integration overview
page. Also duplicate and specialize the instantiation and model bits, which
differ between the compiled code and the interpreter.

Finally, fix the generated C++ docs to not mention that there's a constructor,
instead we generate a constructor function.
2021-08-27 16:56:36 +02:00
Simon Hausmann
499f75455e Re-order the side bar in the C++ docs
The new order is

    1. Getting Started
    2. C++ / .60 Integration
    3. Reference

The second section will host a broader introduction that is currently hiding
in the namespace.
2021-08-27 14:44:33 +02:00