Commit graph

110 commits

Author SHA1 Message Date
Olivier Goffart
2ece3817cc Make ModelHandle a struct
Last commit broke for structures containing models, because models are not PartialEq.
So we need to implement PartialEq for ModelHandle. Which means a struct needs to
be created
2020-10-31 13:32:19 +01:00
Olivier Goffart
263df7dc63 Remove the www from all sixtyfps.io URL 2020-10-29 11:06:06 +01:00
Olivier Goffart
d3801e26d3 Change the syntax of structures to require the struct keyword 2020-10-27 16:09:05 +01:00
Olivier Goffart
aeade826fe New runtime implementation for the box layout
Currently only horizontal layout is supported
2020-10-26 14:19:12 +01:00
Olivier Goffart
20cfb65e53 Bump version 2020-10-22 08:41:45 +02:00
Olivier Goffart
c50b9d73d3 Document the generated C++ code 2020-10-21 11:29:25 +02:00
Olivier Goffart
45e8c94535 Some more documentation for the rust backend 2020-10-21 10:35:42 +02:00
Simon Hausmann
0c8fcb5f7a Some edits to the type mappings section of the node docs
Also use a consistent section title throughout.
2020-10-21 09:44:21 +02:00
Olivier Goffart
0c253efb0d Some changes in the rust documentation and its README 2020-10-20 18:02:28 +02:00
Simon Hausmann
dd55f5205d Replace wildcard version with the released one for now 2020-10-13 15:10:24 +02:00
Olivier Goffart
a650f29abe Rename sixtyfps-rs-macro to sixtyfps-macros 2020-10-13 11:10:26 +02:00
Simon Hausmann
a37d42fa0e Add an init function to the Item vtable
This will be called by the run-time and will allow items to set up
bindings that rely on internals that should not be exposed to the
compiler/runtime.
2020-10-12 16:49:44 +02:00
Olivier Goffart
4169254169 StandardListView in rust 2020-10-08 16:22:16 +02:00
Olivier Goffart
1b506a1b03 Move ther model code from the rust API to the corelib
We will need it in the dynamic component
2020-10-02 18:11:35 +02:00
Simon Hausmann
e5dfb3a4c0 Implement basic focus handling
Similar to the mouse_grabber, we use a VisitChildrenResult field to
track the focus item within a component. Unlike the mouse grabber
however, it is set/cleared using dedicated focus events.

The key event now routes the key event directly to the focus item.

The focus can be requested via set_focus_item on a window, which the
TextItem does.
2020-09-25 10:43:47 +02:00
Simon Hausmann
aa5babffe1 Prepare for key event delivery to a specific focus item
Begin by routing key events through the component. In the future that
will direct the event to the focus item.
2020-09-25 10:06:15 +02:00
Simon Hausmann
2b76e9277a Prepare for allowing an item mouse handler to request focus
In the future the TextInput will request focus on mouse click,for
example.

Pass the outer-most component through to ItemVTable's input_event.

For the purpose of disambiguating this component from any nested
component instantiated by a repeater or so, it's called the
app_component.

The ComponentVTable takes a reference to a ComponentRefPin instead of a
ComponentRefPin by value, as the vtable macro gets confused otherwise
and thinks it's a self argument.
2020-09-25 10:06:15 +02:00
Simon Hausmann
7ca66d62b9 Fix crash in TextInput when deleting a left-directed selection
When selecting to the left, the anchor remains to the right of the cursor.
When deleting such a selection, we fetch the cursor and anchor using a helper
method, which ensures that the anchor is to the left of the cursor.
Finally when setting the cursor then to the anchor, we need to also
set the anchor, since both were swapped.

This also add an automated test for this scenario.
2020-09-23 17:33:09 +02:00
Simon Hausmann
7053aee0c8 Pass the ComponentWindow to ItemVTable::input_event 2020-09-18 16:18:48 +02:00
Olivier Goffart
cbd8c6aefc Documentation for the newly added struct type 2020-09-17 13:14:01 +02:00
Olivier Goffart
913d680333 Recactor rust Model after first round of API review
- Remove EmptyModel and use an Option
 - Make ModelRc a type alias
 - Rename ArrayModel into VecModel
2020-09-16 14:25:57 +02:00
Simon Hausmann
625cb6c6b8 Add a constructor to Text and let the color default to black
We really shouldn't require specifying a color for every Text {} element just in order
to see *some* text.

For Rectangle OTOH transparent is a good default (and thus for Color), hence
this change just to Text.

Right now the constructor bit is also a bit repetitive, this could
perhaps be folded into BuiltinItem to generate the ffi, default impl and
forward to an init function if it exists.
2020-09-16 08:20:13 +02:00
Simon Hausmann
546818ee55 Add key event data structures and event function boiler plate 2020-09-15 11:16:55 +02:00
Olivier Goffart
0d8a38577d Todo example: make the "add todo" button do something 2020-09-14 16:38:45 +02:00
Simon Hausmann
3c2172d043 Use new-style intra-crate rust-doc links instead of relying on .html links 2020-09-09 18:53:59 +02:00
Olivier Goffart
8761ca80a3 Add SharedArray::push and adjust a bit the API 2020-09-09 18:47:15 +02:00
Simon Hausmann
e87a650c46 Add SharedArray to the public Rust API 2020-09-08 22:54:58 +02:00
Simon Hausmann
19cce012a0 Add ARGBColor<T> to the color API
As discussed in the last API review, this replaces the as_rgba_f32/u8
"accessor" functions by returning a struct with named fields.
2020-09-08 22:11:23 +02:00
Olivier Goffart
51d48aad32 Some doc changes 2020-09-03 16:57:48 +02:00
Simon Hausmann
670091a773 Remove sixtyfps::EasingCurve from the public Rust API
It's not needed in public API usage right now.
2020-09-03 15:48:17 +02:00
Olivier Goffart
8a7afbc238 Documents the elements 2020-09-02 18:57:24 +02:00
Olivier Goffart
f1ad78bc25 Qt style support for the rust backend
Need to set the SIXTYFPS_STYLE=native env variable while compiling
2020-09-01 12:25:11 +02:00
Olivier Goffart
6d41b1981d Move the Qt style to a new backend: the Qt backend
Currently the Qt backend still redirect everything to the GL backend,
but the goal is to use QPainter and QWindow

This also adds a "default" backend, whose goal is to select the proper
backend at compile time
2020-08-31 17:26:04 +02:00
Simon Hausmann
5dbd0b213c Add support for grid layout padding 2020-08-28 15:06:14 +02:00
Olivier Goffart
ef16733a88 Attempt to render the documentation example.
Need polishing
2020-08-27 19:34:17 +02:00
Simon Hausmann
fdd522a7e4 Link to the "website" from the Rust docs 2020-08-26 18:58:35 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Olivier Goffart
304b0e7b0e Make sure the langref doc can be opened if the package is on crates.io
One need to make a symlink because the files need to be in the package
2020-08-25 14:42:18 +02:00
Olivier Goffart
ea1f215367 Some polishinbg of the .toml files
- Give all the sixtyfps-* create a 0.0.1 version
 - Make sure that the internal dependences are using the exact same version
   (so "=0.0.1")
 - Add the description/homepage/repository fields in the .toml files
 - Set publish=false  to crates that are not meant to be published on crates.io
2020-08-24 16:28:11 +02:00
Simon Hausmann
0e10008c47 Use ".60" design markup consistently
It's a mark up language that targets the design, not say the business logic.
2020-08-21 13:59:30 +02:00
Simon Hausmann
8df8db8733 Don't try to reference docs from other crates using relative links
This won't work on docs.rs, so instead re-export the types the same way that
text of the link was already suggesting.
2020-08-21 13:42:38 +02:00
Simon Hausmann
490cb299a8 Ignore doc test build for pseudo-code 2020-08-20 16:32:16 +02:00
Simon Hausmann
25156d9aa3 Table'ify the types in the language reference 2020-08-20 15:51:38 +02:00
Simon Hausmann
6ebe008768 Add a table to the Rust docs for the mapping from .60 property types 2020-08-20 15:25:28 +02:00
Simon Hausmann
5d9d283ec8 Include some documentation about the generated APIs 2020-08-20 15:06:10 +02:00
Simon Hausmann
e3fb0c09dd Some improvements to the Rust API crate documentation
Some general cleanups and include the language reference right there using the technique described at https://blog.wnut.pw/2020/03/24/documentation-and-unstable-rustdoc-features/
2020-08-20 10:05:52 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
4a74f6d0a3 Implement releasing graphics resources in Rust via Drop
Further enhances #12
2020-08-14 13:44:53 +02:00
Simon Hausmann
d3a474af26 Move corelib::Component and friends back into their dedicated component module 2020-08-12 11:39:07 +02:00
Simon Hausmann
b21aa4f9e7 Rename PropertyListenerScope to PropertyTracker 2020-08-12 11:31:33 +02:00