Commit graph

80 commits

Author SHA1 Message Date
Simon Hausmann
7053aee0c8 Pass the ComponentWindow to ItemVTable::input_event 2020-09-18 16:18:48 +02:00
Olivier Goffart
8134fe5088 Support for named type as property 2020-09-17 13:14:01 +02:00
Simon Hausmann
26ae1bfdb2 Add From<String> and Into<String> for SharedString 2020-09-14 08:49:41 +02:00
Olivier Goffart
42aa91e3eb Support for signal with arguments in the interpreter 2020-09-09 11:27:58 +02:00
Simon Hausmann
6f8018127a Fix standalone node api build
Right now the code calls print() on the diagnostics, so we do need the display-diagnostics feature of the compiler lib.
2020-09-07 20:40:06 +02:00
Olivier Goffart
9f026c820d Parse declaration of signal with arguments 2020-09-07 17:41:24 +02:00
Olivier Goffart
ae90a59513 Attempt to fix the window build by bringing a git version of neon 2020-09-05 17:26:09 +02:00
Simon Hausmann
ff9c118e07 Propagate warnings to the end of the compilation step and print them 2020-09-04 20:34:20 +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
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +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
7f1d9f5252 Commit correct license tags to Cargo.toml
For now that's GPL-3.0 only, but this can be changed :-)
2020-08-18 10:12:59 +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
aafb96cb93 Get rid of abi::datastructures::WindowProperties
Instead, pass a reference to the root item when mapping the window,
at which point we can downcast to the new Window item. If we have one,
then we'll read its width/height (for initial values) and install
bindings to keep them up-to-date.
2020-08-12 09:44:42 +02:00
Simon Hausmann
f2eec61968 Add a window to the top-level component
This means that we always have a window and for the C++
API we don't require this ComponentWindow use anymore.
2020-08-11 13:38:38 +02:00
Olivier Goffart
f0511c9210 Fix javascript from last commit 2020-08-10 14:11:33 +02:00
Olivier Goffart
f4cce26d51 Test the mouse click 2020-08-10 12:54:29 +02:00
Simon Hausmann
fcc819e395 Add support for enums to the compiler
This replaces the duplicated text alignment enums
2020-08-07 13:15:43 +02:00
Simon Hausmann
aecf6a8878 Center text in buttons in the demo and gallery
This adds horizontal_alignment/vertical_alignment properties, along with
width/height to Text.

This still uses a hard-coded enumeration in the compiler, which is meant
to go away in favor of general enum support.
2020-08-07 10:02:52 +02:00
Simon Hausmann
41671e3efb Represent the window scale factor conversions in the IR
That means less code in the generators and easier to extend in the
future with more built-in functions.
2020-08-04 12:49:37 +02:00
Simon Hausmann
37f874a26b Rename test_ellapse_time to mock_elapsed_time 2020-08-03 17:52:42 +02:00
Simon Hausmann
f2166d91a6 Move tests out of abi 2020-08-03 17:48:17 +02:00
Olivier Goffart
5f38f03a1b Test setting signal handler and a few fix to make it work
We were not parsing CodeBlock node from the signal handler correctly,
we wer eonly taking the first expression instead of the whole codeblock

In JS, emitting signal before the show() did not update the GLOBAL_CONTEXT
needed to emit signals defined in JS
2020-08-03 15:01:10 +02:00
Simon Hausmann
ce7f66320b Move datastructures::Resource into graphics
It's only used for graphics at the moment and used
for image resources.
2020-08-03 12:47:05 +02:00
Simon Hausmann
aa398c6277 Rename Resource::EmbeddedDataOwned -> EmbeddedRgbaImage 2020-08-03 12:20:17 +02:00
Olivier Goffart
00c32e9c6d vtable: remove the convinient type alias from the macro
If one really need them, they can be implemented by the user
2020-08-03 11:03:24 +02:00
Simon Hausmann
6c5d423cd4 Rename sixtyfps_corelib to sixtyfps-corelib 2020-08-03 10:01:58 +02:00
Olivier Goffart
46a011683f Implement easing curve in the runtime 2020-07-29 15:20:28 +02:00
Olivier Goffart
feec73674f Start implementing easing curve 2020-07-29 15:19:41 +02:00
Olivier Goffart
b8299747c6 WIP: some draft of a Qt style 2020-07-24 17:59:23 +02:00
Simon Hausmann
88fb491837 Add support for mapping elements to different native classes
The Rectangle element has properties for a border outline. If those are
used, then the generated code should use BorderRectangle. But if they are
not used, then we can fall back to just generating a Rectangle.
2020-07-24 17:48:19 +02:00
Olivier Goffart
232848de9e Make sure that there is only one error reported when assigning to invalid
This also start parsing assignment ('=') as a self assignement
but the code generation is not yet implmented
2020-07-24 11:33:00 +02:00
Olivier Goffart
05c5f7c53d Test and fix animations on properties
The animation should not start when the property is initialized, only when the
property is set by the setter
2020-07-23 11:45:34 +02:00
Simon Hausmann
0aaa163058 Add support for specifying include paths to the nodejs API
I tried passing this as a component of the file name (uri style with a query),
but nodejs wants only valid paths for
require() calls. So instead this uses simply an environment variable.
2020-07-19 18:29:37 +02:00
Simon Hausmann
2f0718bffa Add include path options to the viewer and compiler
This allows specifying additional component locations. It works for
simple structs, but not yet for more complex types due to a bug yet to
be fixed :-)
2020-07-17 15:26:35 +02:00
Simon Hausmann
298c8586d2 Fix window property propagation for the nodejs front-end 2020-07-16 08:20:20 +02:00
Olivier Goffart
dfd4a35e35 Set the DPI property according to the window's screen 2020-07-15 18:46:55 +02:00
Simon Hausmann
ddc4fb6e1f WIP: window size
Just playing around with propagating the width/height of the window.
2020-07-15 17:52:14 +02:00
Simon Hausmann
8e047d3761 Simplify compiler diagnostics API
Don't require the callers to hold on to the source code string until an
eventual diagnostics code path is hit. Instead it turns out it's
simpler to let the parser consume the source code as string, where
internally after tokenizing it can be moved into the diagnostics and
from there into the code map if needed.

There are a few places where we now clone the source code, but that's
only in cases where we also extract stuff separately (test code) or the
syntax updater.
2020-07-15 17:34:11 +02:00
Olivier Goffart
24033ecdc3 Support for logical_lenght type 2020-07-15 11:53:19 +02:00
Olivier Goffart
8e7e3aaa7a Make the length its own unit 2020-07-14 17:45:03 +02:00
Olivier Goffart
952ddda7c4 Force duration to have an unit 2020-07-14 16:18:12 +02:00
Olivier Goffart
e00491811b Get rid of the context in properties/signal 2020-07-13 18:49:06 +02:00
Simon Hausmann
6243df1702 Avoid unnecessary path building
When the path was constructed from events (SVG commands), then we don't really need to build an intermediate path,
neither for rendering nor for path layouting.
2020-07-10 13:59:40 +02:00
Simon Hausmann
4b6e549b96 Simplify compiled path data structure
Use two arrays, one for events and one for coordinates. That simplifies
the code generator and the generated code, and it also provides for
a more compact memory representation.
2020-07-10 10:20:59 +02:00
Simon Hausmann
be60079f21 Add support for pre-compiled paths
They are represented as lyon-style path events. We can use this to
compile SVG paths ahead of time and use them
without including lyon's SVG path builder.
2020-07-09 10:43:49 +02:00
Simon Hausmann
c17c06c6e7 Making closing of a path optional
By default paths are not closed and they can be closed using a Close {}
element.
2020-07-09 09:52:09 +02:00
Simon Hausmann
5629683942 Remove PathElements::as_slice()
This function is not needed anymore
2020-07-09 08:54:19 +02:00
Simon Hausmann
f646809ff4 Added ArcTo element for paths 2020-07-07 16:02:46 +02:00
Simon Hausmann
1ab71b8ca3 Prepare the path element setup in the run-time for extensibility
Make the anonymous struct for the LineTo variant in the PathElement enum
as separate structure, which can be introspected using rtto::FieldInfo.
2020-07-07 14:14:17 +02:00