Olivier Goffart
95c4bac794
Add a dealloc and drop_in_place function to the ComponentVTable
2020-11-06 17:13:01 +01:00
Olivier Goffart
11e55dd8d2
String -> Float conversions
2020-11-03 15:19:58 +01:00
Olivier Goffart
4a182ef4d0
Layout alignment
2020-11-03 12:22:34 +01:00
Olivier Goffart
661982e747
Fix bindings on animation duration
2020-11-02 21:15:22 +01:00
Olivier Goffart
a82c23fc41
Add ability for the native style to export native Globals
2020-11-02 16:13:04 +01:00
Olivier Goffart
232d59bf24
Ensure that the repeater are updated when layouting box layout
2020-11-02 11:37:04 +01:00
Olivier Goffart
1eb7203ec8
Also do the comperty comparison in C++
2020-10-31 14:36:38 +01:00
Olivier Goffart
ab14978fa8
Support for
in box layout in the C++ backtend
2020-10-31 09:10:16 +01:00
Olivier Goffart
a4b476bdf3
implement Component::layout_info in C++
2020-10-29 19:08:52 +01:00
Olivier Goffart
5face45c51
Rename Component::compute_layout to apply_layout
...
And pass the expected rectangle.
This is currently not used yet but will be needed when we can have
repeated elements within a box layout
2020-10-29 19:08:52 +01:00
Olivier Goffart
1479bc956e
Support for global in the interpreter
2020-10-29 11:01:04 +01:00
Olivier Goffart
7f7bf6acb4
Access of global items from C++
2020-10-29 11:01:04 +01:00
Olivier Goffart
70d6648880
Remove some remains of code that allowed to use Component as Object
2020-10-27 16:25:21 +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
333c96fd79
Change Type::Object to be able to hold a name
...
Internally, structure will be represented with a Type::Object with a name
instead of a Component with a void base type
2020-10-27 16:09:05 +01:00
Olivier Goffart
4a702243d1
Fix C++ layouts
2020-10-27 08:16:02 +01:00
Olivier Goffart
9ec2013a3a
Layout refactor: move the constraints dirrectly into the layout item
2020-10-26 17:17:29 +01:00
Olivier Goffart
47be71e16d
Introduce layout stretching
2020-10-26 16:40:35 +01:00
Olivier Goffart
7ff0b4b73f
Vertical layout
2020-10-26 14:19:12 +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
537051a1e4
Refactor get_layout_info_ref to contains the constraints
2020-10-26 14:19:12 +01:00
Olivier Goffart
c659c4369a
Refactor the Layout generation code
2020-10-26 10:07:31 +01:00
Olivier Goffart
de17702a38
Layout: Attempt to reduce code duplication between rust and c++ codegen
2020-10-24 12:15:21 +02:00
Olivier Goffart
ed01d8369a
Start working on VerticalLayout/HorizontalLayout
2020-10-23 14:08:58 +02:00
Olivier Goffart
27a6ff1227
Move Type and related concepts in a different module
...
Leaving only the TypeRegister in the typeregister module
2020-10-23 11:17:14 +02:00
Olivier Goffart
4fb87f401e
Some fixes for the initializations of two way bindings within sub components
...
There are still more issues
2020-10-20 14:33:06 +02:00
Olivier Goffart
837cc769eb
Fix conversion to void in cpp
...
The test test_cpp_conditional_stm was failing because it was trying to return void
2020-10-19 20:37:11 +02:00
Simon Hausmann
071ab9fda1
Prepare for use of percentages as widths in layouts
...
Delay the conversion of percentage to the float to code generation type
by inserting the multiplication into the syntax tree. That way we will
be able to detect plain uses of percetages and interpret them
differently.
2020-10-16 15:38:35 +02:00
Simon Hausmann
d8459ef00e
GridLayout cleanup
...
Separate out the padding and spacing parameter handling. A separate data
holds these and the code generation is also split out into
helper functions in the C++ and Rust generator. This will allow re-use in the future.
2020-10-13 22:52:04 +02:00
Simon Hausmann
0b78a782b7
Minor C++ grid layout codegen cleanup
...
We don't need to use local variables for the layout width/height
2020-10-13 22:45:22 +02:00
Simon Hausmann
e5b8e5d64d
Prepare for more code sharing in layout handling
...
Move layout constraints for layout items into a separate
helper struct.
2020-10-13 18:17:47 +02:00
Simon Hausmann
1b4317a93a
Minor cleanup in the layout code in the compiler
...
Free the term "Layout Constraints" for use later for the actual constraints
of layouts.
2020-10-13 18:00:54 +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
58b176d10c
ListView in C++
...
This make sure the layout is correct, but does not implement the
optimization to only instentiate visible items
2020-10-05 11:32:43 +02:00
Simon Hausmann
7e0e7b43f0
Add support for calling focus() on TextInput elements
...
This allows activating text inputs in signal handlers connected for
example to buttons.
This implements parts of #55
2020-10-01 08:52:45 +02:00
Simon Hausmann
9ad8968529
Add support for the initial_focus synthetic property
...
Setting it will translate to a set_focus_item call in the constructor.
This implements parts of #55
2020-09-30 15:11:01 +02:00
Olivier Goffart
2050f08f1e
Ability to make change to the model property
2020-09-30 15:04:32 +02:00
Olivier Goffart
2d01b92c84
Ability to change part of objects from the .60 syntax
2020-09-30 11:33:36 +02:00
Simon Hausmann
1e1476108a
Fix valgrind error in test_cpp_focus_change
...
TextInput has a Cell<bool> which becomes a plain bool in the cbindgen generated C++ struct.
When declaring the members in our generated code, make sure to explictly initialize them.
That way we get the same defaults as in Rust (or
at least should).
2020-09-29 15:01:01 +02:00
Olivier Goffart
f4f4775a19
Refactor the C++ Repeater to do the same as the Rust one
2020-09-29 14:20:43 +02:00
Olivier Goffart
3b6679ed4b
Two ways binding works also work as three ways binding and more
...
A side effect is that the order of calling set_binding and link_two_ways is no longer relevant
2020-09-28 10:42:27 +02:00
Olivier Goffart
abe24e2e9e
C++ two way bindings
2020-09-25 15:21:37 +02:00
Olivier Goffart
9d53c45291
Implement two ways binding in rust
2020-09-25 12:57:08 +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
Olivier Goffart
8361ef4019
Start code egeneration for the two ways binding
...
This is only meant to include the cases in which the property are optimized.
Does not work yet for the dynamic component
2020-09-24 14:37:16 +02:00
Olivier Goffart
4981c3ca75
Some check for the two way bindings
2020-09-23 14:06:08 +02:00
Olivier Goffart
2ee861365c
Flickable: expose the viewport property as viewport_*
...
The code generator forward that the the viewport
2020-09-22 13:52:27 +02:00
Simon Hausmann
7053aee0c8
Pass the ComponentWindow to ItemVTable::input_event
2020-09-18 16:18:48 +02:00