Commit graph

874 commits

Author SHA1 Message Date
Olivier Goffart
15781411de C++ interpreter: Cast the pointer, not the reference
May result in warnings otherwise

```
slint_interpreter.h:426:79: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  426 |                 &inner, &reinterpret_cast<slint::SharedVector<ValueOpaque> &>(array))) {
      |                                                                               ^~~~~
```
2022-03-09 13:11:05 +01:00
Simon Hausmann
583c7a1b80 Fix C++ build
With ImageInner::StaticTextures (the variant) and StaticTextures (the
struct), we need to disambiguate for the generated enum contructor
functions. This is done by prefixing the enum variant with their name.
2022-03-03 14:39:11 +01:00
Jared Moulton
fdbc8056b3 Add an option to draw *'s instead of characters for password fields 2022-03-02 15:47:32 +01:00
Simon Hausmann
39a2290221
Build the backends without rtti unless needed (#1001)
* Build the backends without rtti unless needed

Only the interpreter needs the rtti generated code.

 * Since `SlintElement` emits `#[cfg(feature = "rtti")]` tokens, each
 crate using `SlintElement` needs to have an `rtti` feature.
 * The selector gets backend specific rtti selection features, in order
   for the interpreter to enable them.
* Enable rtti when building the C++ project with the interpreter enabled
2022-03-01 18:37:07 +01:00
n-raine
beda5aca07 Add dark style detection support for GL backend
With the help of dark-light crate this is now exposed as dark-style
boolean property in NativeStyleMetrics.

Co-authored-by: Olivier Goffart <olivier@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-03-01 16:41:20 +01:00
Olivier Goffart
0dc188f328 Support for referring to other globals from globals
- We need to make sure that the initialization of global is in the right order.
 - In C++ and rust, we need to add accessor to the global component
 - There can be `PropertyReference::Global` in binding of globals
 - The interpreter globals need to hold references to the global they may depend on

Fixes #175
2022-02-28 10:14:34 +01:00
Olivier Goffart
350f0d0d6a
C++ interpreter API: add a Value::Value(int) constructor (#974) 2022-02-21 14:00:51 +01:00
Olivier Goffart
ea2e91ece9 Upgrade Catch2
I get a compilation error otherwise

```
_deps/catch2-src/single_include/catch2/catch.hpp:10830:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10830 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~

```
2022-02-21 13:30:01 +01:00
ogoffart
ecd0fb7ecd Bump version number to 0.2.1 2022-02-10 16:25:28 +01:00
Olivier Goffart
e429968a15 Update version number in the docs 2022-02-09 17:08:19 +01:00
Olivier Goffart
567b54501a Upate the links to the templates repository
Also update a few more links and reference to slint in the readme
I know this means that we will have invalid links and instructions until the release,
but the instructions are already broken anyway
2022-02-09 15:49:18 +01:00
Olivier Goffart
3d209287c2 Docs: add a note that only exported global from the main file are exposed 2022-02-09 14:49:20 +01:00
Simon Hausmann
b2e6745bd3 Remove two more uses of the sixtyfps.io email 2022-02-09 13:16:51 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Simon Hausmann
6d923b9367 Improve GL backend feature docs to convey cross-platform support
Apply suggestion from code review
2022-02-08 14:47:25 +01:00
Simon Hausmann
fcd1faa336 Fix up the C++ docs explaining how to create a wayland-only build 2022-02-08 14:47:25 +01:00
Simon Hausmann
90d67be1a4 Document the feature renaming in the migration guides 2022-02-08 14:47:25 +01:00
Simon Hausmann
be5b8c1c46 Rename the backend-gl feature to backend-gl-all 2022-02-08 14:47:25 +01:00
Simon Hausmann
48f3f47401 Rename the x11 and wayland features to backend-gl-x11/wayland 2022-02-08 14:47:25 +01:00
Olivier Goffart
753784c331
C++: drops IntSize in favor of Size<T> (#922)
Fixes #909

Since we declare the struct in C++, we don't need to declare it in
rust for cbindgen anymore, as long as we expose the Size2D type from
euclid to the cbindgen_private namespace
2022-02-08 14:12:52 +01:00
Olivier Goffart
40c0e446c8 C++ migration guide: merge the two cmake entries
I kept it at the beginning because that's the first thing to do while migrating
2022-02-08 12:34:57 +01:00
Olivier Goffart
0e0142c9cf Bump Corrosion to v0.1.0 2022-02-08 11:42:54 +01:00
Olivier Goffart
1425ef63de Change the Url from sixtyfps.io to slint-ui.com
Also, change the URL of the logo in the docs
2022-02-08 08:52:46 +01:00
Olivier Goffart
00ff5e21a7 Update git repository URL 2022-02-08 08:26:21 +01:00
Olivier Goffart
91e107150e Merge remote-tracking branch 'origin/wip/rename'
Conflicts:
	examples/opengl_underlay/index.html
	examples/opengl_underlay/main.cpp
2022-02-08 07:29:41 +01:00
Simon Hausmann
ee59e9931f Use the logo URL for the C++ docs
It appears that

    https://github.com/readthedocs/sphinx_rtd_theme/pull/1171

and

    https://github.com/sphinx-doc/sphinx/pull/9381

have been released in their respective packages and we can use the logo url in our docs.
2022-02-07 17:22:18 +01:00
Simon Hausmann
906aa0b8c2 Use Tobias' new adjusted diagram 2022-02-07 16:23:41 +01:00
Tobias Hunger
de4e195280
Rename internal crates and add a README.md to them
The README.md contains the warning that used to be in lib.rs.

Add README.md files to all internal crates

... pointing to the official public crate to use instead.

Rename internal crates

fixup: README files

fixup rename
2022-02-07 13:12:48 +01:00
Simon Hausmann
0b6beb081b Minor fixup to the C++ rendering notifier API
Add the graphics state enum to the callback, too. When we add support for different backends,
it would be nice if it didn't require an API change.

 It's duplicated from Rust
because it doesn't provide values. The WebLG one doesn't make sense for C++ and
the proc address closure isn't ffi safe.

(It could be manually bridged thought)
2022-02-07 08:50:09 +01:00
Olivier Goffart
4115af88bd Fixup previous merge 2022-02-04 17:43:15 +01:00
Simon Hausmann
125b90a64b Merge remote-tracking branch 'origin/master' into wip/rename
Conflicts:
	api/cpp/cbindgen.rs
	api/cpp/include/slint.h
	examples/CMakeLists.txt
	examples/imagefilter/Cargo.toml
	examples/plotter/main.rs
	internal/backends/mcu/lib.rs
2022-02-04 16:47:20 +01:00
Simon Hausmann
18bba6ede4 Add sixtyfps::Window::request_redraw()
This allows scheduling a redraw of a Window explicitly. Unfortunately it
comes with a winit caveat :(
2022-02-04 15:41:53 +01:00
Simon Hausmann
8959eac3d0 Add rendering callbacks to sixtyfps::Window
This API allows specifying a callback that will be invoked when setting
up graphics (great for compiling shaders), before rendering a frame (but
after the clearning of the surface background), after rendering a frame
(before swapbuffers) and when releasing graphics resources.
2022-02-04 15:41:53 +01:00
Tobias Hunger
c273537990
Use logos from the logo folder over the vscode-extension icon 2022-02-04 14:28:10 +01:00
Tobias Hunger
c2d4924294
Use new logo in C++ docs 2022-02-03 14:27:15 +01:00
Tobias Hunger
03f78af987
Update some .60 to .slint 2022-02-02 17:29:40 +01:00
Olivier Goffart
d4c1130130 Rename more occurences 2022-02-02 17:19:31 +01:00
Simon Hausmann
2bba5be38d Fix yocto instructions 2022-02-02 16:55:26 +01:00
Tobias Hunger
1779f4cb02
Polish C++ README 2022-02-02 16:52:17 +01:00
Tobias Hunger
1534f87e30
Change authors to Slint Developers 2022-02-02 16:21:34 +01:00
Olivier Goffart
3594c20153 Replace SixtyFPS in many locations (Uppercase) 2022-02-02 15:49:18 +01:00
Simon Hausmann
f48d7d9f9e SixtyFPS -> Slint in the C++ documentation 2022-02-02 15:19:13 +01:00
Olivier Goffart
ad4eea9e96 Merge remote-tracking branch 'master' into wip/rename
Conflicts:
	.reuse/dep5
	Cargo.toml
	api/cpp/README.md
	api/cpp/docs/conf.py
	api/rs/slint/Cargo.toml
	docs/development.md
2022-02-02 15:04:22 +01:00
Olivier Goffart
62b269ae44 Replace sixtyfps- 2022-02-02 14:46:27 +01:00
Olivier Goffart
d2d6a5cc6a Rename sixtyfps_ 2022-02-02 14:25:56 +01:00
Olivier Goffart
fc6b7cc966 Replace sixtyfps:: almost everywhere 2022-02-02 13:50:44 +01:00
Simon Hausmann
b45433951a Rename two more pre-processor variables 2022-02-02 13:39:11 +01:00
Olivier Goffart
69908a32b6 Rename sixtyfps-viewer -> slint-viewer 2022-02-02 13:19:40 +01:00
Simon Hausmann
d0b6ef985a Fix method names of internal helper functions for animated bindings 2022-02-02 13:09:20 +01:00
Simon Hausmann
fcf59f3793 Rename the C++ header files 2022-02-02 13:07:26 +01:00