Simon Hausmann
6e3fcd1b08
Add row data tracking to C++ sixtyfps::Model
...
This works the same way as in the Rust model notify.
2022-01-14 13:38:25 +01:00
Simon Hausmann
083ae5692b
Fix the Rust/C++ Timer API to be more convenient to use
...
Allow calling restart() on a repeated timer if it has been previously stopped.
2022-01-05 13:26:28 +01:00
Simon Hausmann
f557a27556
Complete the C++ Timer API
...
With this patch it matches the Rust API, with start(), restart(), running() and
a default constructor.
2022-01-05 12:10:29 +01:00
Tobias Hunger
bfca0e3573
Mass update copyright messages to be more REUSE compliant
2021-12-22 10:06:12 +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
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
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
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
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
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
70c57844b7
Add invoke_global_callback to the C++ interpreter API
2021-08-27 13:36:48 +02:00
Olivier Goffart
0fad27e23e
Add set_global_callback in the C++ interpreter API
2021-08-27 13:36:48 +02:00
Olivier Goffart
81688906f7
C++ Interpreter: add API to get/set global value
2021-08-27 13:36:48 +02:00
Tobias Hunger
aea4ecca99
Apply pre-commit hooks to all files
2021-08-17 22:38:16 +02:00
Simon Hausmann
a752c798b8
Changed C++'s SharedVector::clear() to not preserve capacity when shared
2021-08-12 13:41:08 +02:00
Simon Hausmann
511027dad0
Implement SharedVector::clear() for C++
2021-08-12 13:41:08 +02:00
Olivier Goffart
532827b646
Fix the C++ interpreter API compatibility after the change from _ to -
...
Property name with _ should still be supported by set_property/get_property
2021-08-10 22:21:01 +02:00
Olivier Goffart
9ffcd34d1b
Test for angle in the C++ interpreter API
2021-07-26 17:36:02 +02:00
Olivier Goffart
07bf0974d7
C++: Expose conversion betwen Value
and Image
...
Closes #350
2021-07-26 14:12:32 +02:00
Simon Hausmann
eaddbe664e
internal cleanup: Rename ComponentWindow to WindowRc
...
That's all it is nowadays, it's a wrapper around Rc<Window>. It's not an
alias because we need to also "wrap" it to C++ via cbindgen, but that's
about it.
2021-07-21 20:33:02 +02:00
Olivier Goffart
13bd828b96
Update license date
2021-07-02 15:55:54 +02:00
Olivier Goffart
7c1dbb949b
Fix C++ test
2021-07-01 14:23:57 +02:00
Olivier Goffart
63cf84d21f
More MSVC warnings fixes
2021-07-01 14:16:41 +02:00
Simon Hausmann
7f8f1b3105
Hide Property<T> and PropertyTracker<T> from the public C++ API
...
Move those two classes into the private_api namespace, which is excluded
from the API reference documentation.
For generate code the explicit qualification of Property<T> is changed,
for the cbindgen generated item types the private_api namespace is
pulled into the cbindgen_private namespace.
2021-06-21 15:50:58 +02:00
Simon Hausmann
85474f7670
Add support for sixtyfps::Image::size() in C++
...
Also added a unit test for the C++ implementation.
2021-06-20 11:18:28 +02:00
Olivier Goffart
7b63bb7d65
Allow to simulate key event with the interpreter (C++)
2021-06-11 11:26:21 +02:00
Simon Hausmann
c0511a54ea
Rename ComponentDefintion::callback_names() to just callbacks()
...
That's consistent with properties().
2021-06-07 12:08:35 +02:00
Simon Hausmann
855808f9b5
Add API to the Rust and C++ interpreter library to return the names of all publicly declared callbacks
2021-06-07 11:43:04 +02:00
Simon Hausmann
fb19588c8c
Add missing C++ sixtyfps::ComponentDefinition::name()
...
It was already present in Rust
2021-06-07 11:30:22 +02:00
Olivier Goffart
236011d17c
Make ComponentDefinition::properties only list the public properties as it should
...
Fixes #242
2021-05-25 15:48:22 +02:00
Olivier Goffart
0034a3e67d
Fix restarting the event loop with the GL backend
...
We must reset the proxy to a queue so one can restart it with pending events
2021-05-11 17:48:56 +02:00
Olivier Goffart
aabd320e83
C++ Api to run a functor from a thread
2021-05-11 16:42:59 +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
Simon Hausmann
70653ec7cd
Add C++ API for ComponentDefinition::properties()
2021-03-31 08:42:54 +02: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
Simon Hausmann
b51549ab58
Fix Struct::iterator test to be order agnostic
2021-03-23 17:49:28 +01:00
Simon Hausmann
e3f1e51a7a
Some basic class docs for Struct::iterator and two basic tests
2021-03-23 17:02:37 +01:00
Olivier Goffart
bd6cace54c
Test and fix C++ invokation of callback
2021-03-22 14:30:00 +01:00
Olivier Goffart
d79131f18f
Split the tests into two files for the interpreter and others
2021-03-22 11:24:11 +01:00
Simon Hausmann
e1f9347aaa
Add a diagnostics getter to ComponentCompiler
2021-03-19 18:34:39 +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
3588d6ffbe
Start exposing ComponentDefinition to C++
2021-03-19 16:50:12 +01:00
Simon Hausmann
591ae8557b
Add include_paths setter/getter to ComponentCompiler
2021-03-19 09:56:46 +01:00
Simon Hausmann
7af77839ad
Add the skeleton for CompilerCompiler in C++
2021-03-19 09:26:42 +01:00
Simon Hausmann
8916b7e13e
Add a range and initializer list constructor to Struct
2021-03-18 15:28:02 +01:00
Olivier Goffart
09b7b92dbe
Value comparison in C++
2021-03-18 15:26:53 +01:00