Olivier Goffart
ba1aff84d0
Layout refactoring: C++ part
2021-05-11 14:59:57 +02:00
Olivier Goffart
720001a223
Remove the solve_layout from the component vtable
...
no longer required
2021-05-11 14:59:57 +02:00
Olivier Goffart
988c2b0b9d
Use the testing backend for the C++ integration tests
2021-05-11 11:40:26 +02:00
Simon Hausmann
c6a4841cd4
Simplify item vtable retrieval in C++
...
Use a macro instead of a template function to make the getter vs. global
symbol choice.
2021-05-11 07:55:51 +02:00
Simon Hausmann
28701d2f90
Fix item vtable usage on Windows
...
The item tree is intended to be initialized with pointers to the item
vtables, which are implemented using data relocation records that
resolve to the symbols exported by the sixtyfps_cpp shared library.
On windows, according to
https://docs.microsoft.com/en-us/cpp/c-language/rules-and-limitations-for-dllimport-dllexport?view=msvc-160
such data relocations are not supported, so this patch implements the
fallback through getter functions.
2021-05-10 22:54:06 +02:00
Simon Hausmann
4198513832
Add a dummy indirection in C++ for the item vtable access
...
This will allow for a compile-time decision in the future whether
to use the vtable symbol or getter function.
2021-05-10 22:54:06 +02:00
Simon Hausmann
98a91ec3e5
Generate item vtable symbol declarations via cbindgen xtask
...
... instead of declaring them by hand in sixtyfps.h
This will make it easier to introduce an indirection in one place.
2021-05-10 22:54:06 +02:00
Olivier Goffart
052ea15989
Extends the C++ API docs for the interpreter a bit
2021-05-06 10:03:27 +02:00
Simon Hausmann
1e089389e5
Remove the example code from the interpreter namespace docs again
...
I can't seem to convince sphinx/breathe/doxygen to include them like
they work in the class docs.
I tried the markdown quotes, spaces, \code/\endcode, \rst/\endrst but no luck yet.
2021-04-27 14:11:46 +02:00
Simon Hausmann
140de87351
Add a brief overview section to the C++ interpreter namespace
...
This mirrors the Rust module side.
Unfortunately the code examples aren't rendered correctly :(
2021-04-27 13:02:41 +02:00
Olivier Goffart
e7f5578617
Also make the repeater's is_dirty as Property in C++
2021-04-27 11:24:19 +02:00
Olivier Goffart
3ab11b62e6
C++ SharedString API: allow assigning from const char *
...
There is already a constructor that takes a char*, so there should be an
assignment operator as well
2021-04-27 10:37:27 +02:00
Olivier Goffart
ba2f2d5719
Add an Opacity element that does nothing
2021-04-15 10:17:52 +02:00
Simon Hausmann
afe3df6381
Remove the public API for registering fonts by path or memory chunk
...
This is not needed anymore in the light of being able to write `import "blah.ttf"` in .60 markup
2021-04-14 10:01:33 +02:00
Simon Hausmann
b8e621a76b
Fix C++ build
...
Add the preferred size merging logic also to C++ LayoutInfo::merge.
Amends commit 843f52b3c5
2021-04-08 13:16:06 +02:00
Simon Hausmann
7ab518786f
Re-run clang-format on sixtyfps.h
2021-04-08 13:10:41 +02:00
Simon Hausmann
d4178e0935
Avoid duplicate symbols when linking .o files
...
Mark some functions as inline to avoid generating symbols that would
produce duplicate errors when linking multiple .o files that include the
SixtyFPS headers.
2021-03-31 08:42:54 +02:00
Simon Hausmann
3f6bbaf53a
Make it possible to use the C++ headers without CMake
...
Detect the pointer size solely via the pre-processor
2021-03-31 08:42:54 +02:00
Simon Hausmann
70653ec7cd
Add C++ API for ComponentDefinition::properties()
2021-03-31 08:42:54 +02:00
Olivier Goffart
d37856b754
Avoid strict aliasing warning
2021-03-30 18:06:06 +02:00
Simon Hausmann
26b58bb0a5
Docs for PropertyTracker
2021-03-26 10:43:13 +01:00
Simon Hausmann
10189a844c
Make the C++ Value
API a little less error prone
...
Yesterday I ended up accidentally constructing a Value with a string literal
and that turned into a boolean value, resulting in run-time panic.
A deleted `const void *` constructor prevents this by producing a compile error instead of
picking the boolean constructor.
2021-03-26 09:55:13 +01:00
Simon Hausmann
4cbcf2611f
Fix recurring C++ timers
...
* sixtyfps_timer_start needs to *take* the timer id out of the Rust
timer to avoid that the subsequent drop stops the timer again
* For the Qt event loop, call `timer_event()` once before entering
QCoreApplication::exec(), to schedule any timers that were started
beforehand.
* Added a way to quit the event loop gently, in order to use that
from the C++ unit test.
2021-03-25 20:07:12 +01:00
Simon Hausmann
25a1e666d9
Clarify model handling in C++ interpreter slightly
...
* Remove `Value::to_model()` as it is not implemented
* Document that models can be passed to .60 array/object properties
* Add a test for the extraction / setting behavior of arrays.
2021-03-25 16:57:09 +01:00
Simon Hausmann
3bd5b0eadf
Add support for recursive dependency tracking across PropertyTracker instances
...
By default PropertyTracker::evaluate() registers the currently
evaluating binding/tracker as a dependency. This should help with
repeaters and other scenarios where in the run-time we use property
trackers but want to track the overall "dirtyness" in the window with
regards to whether a redraw is needed or not.
The new evaluate_as_dependency_root() function allows skipping this
mechanism and is used for the two trackers in the window.
2021-03-25 12:29:19 +01:00
Olivier Goffart
0985318e3e
Properly drop the refcount of the ComponentWindow
...
Otherwise the ComponentWindow is leak, and so the QWidget is not destroyed
when it should be
2021-03-24 09:26:42 +01:00
Simon Hausmann
b51549ab58
Fix Struct::iterator test to be order agnostic
2021-03-23 17:49:28 +01:00
Simon Hausmann
d5662c117f
A few docs for ComponentInstance
...
There's more to do though
2021-03-23 17:32:19 +01:00
Simon Hausmann
8e05a15704
Polish the ComponentDefinition docs a little bit
2021-03-23 17:21:36 +01:00
Olivier Goffart
1dba04721a
Add a qt_viewer example that uses QWidget
2021-03-23 17:13:41 +01:00
Simon Hausmann
90d3953d42
Polish the ComponentDefinition docs a little bit
2021-03-23 17:10:14 +01:00
Simon Hausmann
e3f1e51a7a
Some basic class docs for Struct::iterator and two basic tests
2021-03-23 17:02:37 +01:00
Simon Hausmann
2a839134f4
More class docs for Value
2021-03-23 15:59:25 +01:00
Simon Hausmann
9e58b39317
Minor doc fix for Value
2021-03-23 14:07:46 +01:00
Simon Hausmann
ab99d9b19e
Some class intro docs for Value
...
and hide the internal typedef
2021-03-23 13:45:53 +01:00
Simon Hausmann
81116607c1
Some class docs for C++ Struct
...
This also hides the internal constructor
2021-03-23 13:23:52 +01:00
Simon Hausmann
c06b0e10e1
Add/sync class summary docs for interpreter::Struct
2021-03-23 12:57:40 +01:00
Simon Hausmann
646ce85ea6
Fix doxygen error
...
It can't parse the std::enable_if bits in the range constructor of Struct,
so skip it.
2021-03-23 11:17:40 +01:00
Olivier Goffart
bd6cace54c
Test and fix C++ invokation of callback
2021-03-22 14:30:00 +01:00
Simon Hausmann
e1f9347aaa
Add a diagnostics getter to ComponentCompiler
2021-03-19 18:34:39 +01:00
Olivier Goffart
b645860e27
Fix bad conflict resolution
2021-03-19 18:30:16 +01:00
Olivier Goffart
f2ffc0ebf6
ComponentDefinition::create in C++
...
Note thate there is a hack so `ComponentHandle<ComponentInstance>` (which is
binary compatible with `VRc<ComponentVTable, ErasedComponentBox>` works
2021-03-19 18:10:38 +01:00
Simon Hausmann
9eecdefb35
Add ComponentCompiler::build_from_path
2021-03-19 17:26:19 +01:00
Simon Hausmann
fd9d154b27
Add getter/setter for the style
2021-03-19 17:17:57 +01:00
Simon Hausmann
59d6866b13
Remove the null state in ComponentDefinition
...
This isn't needed as it turns out and a cleaner API this way
2021-03-19 17:08:04 +01:00
Simon Hausmann
3588d6ffbe
Start exposing ComponentDefinition to C++
2021-03-19 16:50:12 +01:00
Simon Hausmann
9a8c6bf9f7
Move the string_to_slice
helper into sixtyfps_string.h
for easier editing
2021-03-19 14:16:30 +01:00
Simon Hausmann
3bb4b87bc7
Use a free-standing function for the string_view to slice conversion
2021-03-19 13:13:08 +01:00
Simon Hausmann
0c21008861
Add internal convenience API to construct a C++ slice from a string view
2021-03-19 12:54:22 +01:00
Simon Hausmann
591ae8557b
Add include_paths setter/getter to ComponentCompiler
2021-03-19 09:56:46 +01:00