Olivier Goffart
00cc8ec693
Add invoke_global_callback to the 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
a294ab4200
Interpreter: add set_global_callback
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
Olivier Goffart
a1803ec3a0
Interpreter: return a proper error from set_property instead of panic
2021-08-27 13:36:48 +02:00
Olivier Goffart
5f8cea5926
WIP interpreter API to access globals
2021-08-27 13:36:48 +02:00
Olivier Goffart
b07d52cd23
Support aliases to callbacks in globals
2021-08-24 12:36:16 +02:00
Olivier Goffart
d5f4a796ad
Fix interpreter panics when calling callback that weren't set
2021-08-24 11:37:47 +02:00
Olivier Goffart
b42c187ed1
Refactor the way the two-ways biding are represented internaly
...
Don't put them in a fake expression.
This simplifies a bit the expression handling, and will make
possible to fix analysis that needs a vew into the aliases
2021-08-20 18:26:36 +02:00
Olivier Goffart
5efa5bbf1d
Added a commented out debug comment which I often use
...
It allows dumping the lowered object tree
2021-08-19 09:57:13 +02:00
Olivier Goffart
76ca2eed6b
Fix intra-doc links
...
It should be ``[`...`]``, not `` `[...]` ``
2021-08-19 09:17:30 +02:00
Tobias Hunger
91c78f61e9
Janitor: Fix clippy::needless_lifetimes
2021-08-18 00:24:51 +02:00
Tobias Hunger
bbbf6460df
Janitor: Fix clippy::redundant_closure
2021-08-18 00:24:51 +02:00
Tobias Hunger
aea4ecca99
Apply pre-commit hooks to all files
2021-08-17 22:38:16 +02:00
Olivier Goffart
a39dd6ac4f
Interpreter API: preserve the dashes and underscore when listing properties
2021-08-17 18:47:41 +02:00
Olivier Goffart
4e254445d9
Fix interpreter test
2021-08-10 22:21:01 +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
c25538c982
Normalize identifiers to -
instead of _
...
As a result
- The error messages will now show the error with `-` instead of `_`
- The LSP will auto-complete with -
- The interpreter's list of properties will list the property with '-'
(but we made the change so that set_property, get_property, and so on
work also if passed a '-')
2021-08-10 22:21:01 +02:00
Simon Hausmann
0852a7661b
Fix mutable slice API
...
* Change SharedVector::as_mut_slice() to SharedVector::make_mut_slice()
* SharedPixelBuffer::as_mut_slice and SharedPixelBuffer::make_mut_slice()
* SharedPixelBuffer::as_bytes_mut() to SharedPixelBuffer::make_mut_bytes()
This is consistent with Rc::make_mut() and is supposed to emphasize
that, unlike the usual as_* operations, it is not a free operation but
may involve work (detaching the data by cloning it).
Amends commit 7384ebdc32
2021-08-10 16:37:34 +02:00
Simon Hausmann
01c3347d19
Make fluent the new default style
...
It's not ugly :-)
2021-08-10 15:56:38 +02:00
ogoffart
53f286258c
Bump version number to 0.1.1
2021-08-10 08:06:20 +00:00
Simon Hausmann
7384ebdc32
Deprecated SharedVector::as_slice_mut() in favor of SharedVector::as_mut_slice()
...
The standard library uses the latter name.
2021-08-09 14:51:09 +02:00
Tobias Hunger
9dcd107e84
Janitor: Fix clippy::single_match
2021-08-09 13:19:34 +02:00
Tobias Hunger
d50dcf77f5
Janitor: Fix clippy::from_iter_instead_of_collect
2021-08-09 13:19:34 +02:00
Olivier Goffart
16325d5474
Remove dbg!
2021-08-09 12:40:21 +02:00
Olivier Goffart
8728052578
Fix panic when typing into the line edit in the gallery
...
The problem was that the item array's parent was not properly
computed. Leading to corrupted item when getting the parent of the
focus item.
2021-08-09 12:00:17 +02:00
Olivier Goffart
c33e4d76aa
Use proper rustdoc link.
...
Its ``[`...`]`` not ``[[..]]``
2021-08-07 17:07:41 +02:00
Olivier Goffart
c58ffe1589
Better panic message when we reference a property that does not exist
2021-08-06 15:58:13 +02:00
Tobias Hunger
04738a900f
Janitor: Fix clippy::map_clone
2021-08-04 22:50:35 +02:00
Tobias Hunger
ce976a1dbb
Janitor: Fix clippy::useless_conversion
2021-08-04 22:50:35 +02:00
Tobias Hunger
c74565a883
Janitor: Fix clippy::needless_return
2021-08-04 22:50:35 +02:00
Tobias Hunger
24a2021226
Janitor: Fix clippy::needless_borrow
2021-08-04 22:50:35 +02:00
Tobias Hunger
3c9451f94c
Janitor: Fix clippy::needless_question_mark
2021-08-04 22:50:35 +02:00
Olivier Goffart
1dab4c35d9
For embedded data, store the extension in the binary
...
This is usefull for the detection of SVG
2021-08-03 16:15:31 +02:00
Simon Hausmann
9e4b067f38
Provide sixtyfps::Window
by reference in the C++ interpreter API
2021-08-03 10:32:04 +02:00
Simon Hausmann
29f5853332
Provide sixtyfps::Window
by reference in the Rust API
...
This also removes Clone from the Window again, to avoid having to face
the question: Does cloning a window duplicate it on the screen?
2021-08-03 10:32:04 +02:00
Simon Hausmann
66891a299c
Start a new sixtyfps::Window API for Rust, C++, the interpreters and JS
...
The generated component now provides access to a Window type
via the window() accessor function.
This is part of #333
2021-08-03 10:32:04 +02:00
Olivier Goffart
6a32a8b37a
Don't error on empty documents
2021-07-29 17:40:20 +02:00
Olivier Goffart
07bf0974d7
C++: Expose conversion betwen Value
and Image
...
Closes #350
2021-07-26 14:12:32 +02:00
Olivier Goffart
ba32777cab
Refactoring: move the animation in the PropertyBinding struct
...
Since they always belong together.
This will help for issue #193
2021-07-23 15:25:53 +02:00
Tobias Hunger
9539a53480
Janitor: Fix clippy::redundant_clone
2021-07-23 13:48:52 +02:00
Tobias Hunger
97be634b9b
Janitor: Fix clippy::match_like_matches_macro
2021-07-23 13:48:52 +02:00
Tobias Hunger
3e0534afea
Janitor: Fix clippy::needless_lifetimes
2021-07-23 13:48:52 +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
Tobias Hunger
aeebbb1d96
Janitor: Fix remaining clippy::option_map_unit_fn
2021-07-21 19:44:57 +02:00
Tobias Hunger
8b022cd917
Janitor: Fix remaining instance of clippy::iter_cloned_collect
2021-07-21 19:44:57 +02:00
Tobias Hunger
f02ab4d8c3
Janitor: Remove some unnecessary &
2021-07-21 19:44:57 +02:00
Tobias Hunger
a8b2aa2f2d
Janitor: Fix cspell complaining about toint
2021-07-21 19:44:57 +02:00
Tobias Hunger
56fea6e6c3
Janitor: Fix clippy::many_single_char_names
2021-07-21 19:44:57 +02:00
Simon Hausmann
1c285694d7
internal cleanup: Remove the use of ComponentWindow in the interpreter
2021-07-21 17:41:12 +02:00