Commit graph

374 commits

Author SHA1 Message Date
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
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
3d209287c2 Docs: add a note that only exported global from the main file are exposed 2022-02-09 14:49:20 +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
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
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
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
Simon Hausmann
f48d7d9f9e SixtyFPS -> Slint in the C++ documentation 2022-02-02 15:19:13 +01:00
Simon Hausmann
b45433951a Rename two more pre-processor variables 2022-02-02 13:39:11 +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
Simon Hausmann
c4541df175 Prospective windows build fix 2022-02-02 12:50:37 +01:00
Simon Hausmann
7d297da2fc Rename the sixtyfps C++ namespaces 2022-02-02 12:11:27 +01:00
Simon Hausmann
5226feab01 Rename C++ pre-processor macros 2022-02-02 12:11:27 +01:00
Simon Hausmann
c846633708 Rename C ffi functions 2022-02-02 11:12:34 +01:00
Olivier Goffart
692171bf0c Change the 60 blocks to slint blocs in documentation comments 2022-02-02 10:51:42 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Tobias Hunger
842f75e653 [reorg]: Move api/sixtyfps-rs/sixtyfps-* into api/rs 2022-01-31 18:24:33 +01:00