Commit graph

257 commits

Author SHA1 Message Date
Tobias Hunger
d79894769b viewer: Prettify help output
The options in sixtyfps-viewer --help used to look like this:

```
OPTIONS:
        --backend <backend>                         The rendering backend [default: ]
    -I <include path for other .60 files>...
        --load-data <load data file>                Load properties from a json file ('-' for stdin)
        --save-data <save data file>                Store properties values in a json file at exit ('-' for stdout)
        --style <style name>                        The style name ('native', 'fluent', or 'ugly') [default: ]
```

This patch removes the useless "[default: ]" part. These are options,
so even without this text it should be very obvious that the `--style`
and the `--backend` parameters are indeed optional.
2021-10-05 21:40:13 +02:00
ogoffart
8b9717633e Bump version number to 0.1.3 2021-10-05 10:31:45 +00:00
Olivier Goffart
cf2e189245 Small fix to the viewer docs 2021-09-30 11:48:09 +02:00
Olivier Goffart
efae60ae7e
Add README for the sixtyfps-viewer 2021-09-30 10:26:12 +02:00
Olivier Goffart
7db9f3dfa9 Dialog: automatically add clicked callback for the standard button
And make the viewer listen to them and set them to automatically close dialogs
2021-09-30 10:21:13 +02:00
Simon Hausmann
21f9850b43 Small spelling fix 2021-09-29 14:55:08 +02:00
Olivier Goffart
0eb223b2ca Update tools/viewer/main.rs
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-09-24 09:23:48 +02:00
Olivier Goffart
321d985242 Viewer: add ability to load and save property values from/to json
issue #238
2021-09-24 09:23:48 +02:00
Olivier Goffart
fe015a8086 Allow the sixtyfps-compiler and sixtyfps-viewer to read from stdin
By specifing `-` as a path
2021-09-09 15:30:52 +02:00
ogoffart
e54e03148f Bump version number to 0.1.2 2021-09-04 10:08:51 +02:00
ogoffart
53f286258c Bump version number to 0.1.1 2021-08-10 08:06:20 +00:00
Tobias Hunger
1d71a2beeb Janitor: Fix clippy::collapsible_if 2021-08-09 13:19:34 +02:00
Tobias Hunger
24a2021226 Janitor: Fix clippy::needless_borrow 2021-08-04 22:50:35 +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
Tobias Hunger
4bd8920ac4 Janitor: Fix clippy::declare_interior_mutable_const 2021-07-21 19:44:57 +02:00
Tobias Hunger
dc51d4ccda Use impl Default instead of new() constructors 2021-07-12 13:22:25 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Simon Hausmann
cec7dde6e6 Small typo fixes 2021-06-30 16:12:39 +02:00
Olivier Goffart
98cec35080 Increase version numbers 2021-06-28 10:39:43 +02:00
Olivier Goffart
ffb0a9881b Add command line arguments to the LSP
To set the include path, the style, or the backend
2021-06-09 17:15:49 +02:00
Olivier Goffart
1c505edd09 Revert the change to depends on the public crate from our tools
We should probablt re-ecport the function from the interpreter, but one
shouldn't depends both on sixtyfps and sixtyfps-interpreter at the same
time
2021-05-25 15:53:49 +02:00
Simon Hausmann
73f647c2e1 Add the Rust equivalent of sixtyfps::invoke_from_event_loop
The same API exists in C++.
2021-05-25 15:53:49 +02:00
Rishabh Budhiraja
74727d953f
Renames viewer to sixtyfps-viewer and publishes it on crates.io (#237)
* Renames viewer to sixtyfps-viewer and publishes it on crates.io

* Maintain the directory name consistency
2021-05-22 08:34:50 +02:00
Olivier Goffart
3380383787 Bump version number
(Does not include docs and README yet)
2021-04-26 13:16:48 +02:00
Olivier Goffart
31a830e66d viewer: when watching, we also need to watch the main file 2021-04-15 15:05:09 +02:00
Simon Hausmann
afe3df6381 Remove the public API for registering fonts by path or memory chunk
This is not needed anymore in the light of being able to write `import "blah.ttf"` in .60 markup
2021-04-14 10:01:33 +02:00
Olivier Goffart
15298f5626 Add the --auto-reload option to the viewer 2021-04-13 13:55:01 +02:00
Simon Hausmann
4a9cd954b8 Rework the Rust entry point API for the interpreter
Switch to the stateful `ComponentCompiler` concept that we discussed for the C++ API.
2021-03-18 18:20:50 +01:00
Olivier Goffart
48333370a6 Use the new interpreter API in things that depends on it 2021-03-15 17:29:27 +01:00
Simon Hausmann
409475aed2 Rename viewer --font=blah.ttf to viewer --load-font=blah.ttf 2021-02-17 15:30:20 +01:00
Simon Hausmann
445ddd58d5 API cleanup
Remove the `application` infix from `register_application_font`, to
reduce the changes that it might be interpreted to be a function that
also changes the default font in all text elements.
2021-02-17 14:37:31 +01:00
Simon Hausmann
45fe6c3e8d Add the ability to load application fonts by path
The viewer command line tool also gains the ability to specify them via `--app-font=/path/to/font.ttf` , which can be specified multiple times.
2021-02-17 14:16:52 +01:00
Olivier Goffart
fea2478859 Update version number everywhere 2021-01-28 16:34:13 +01:00
Simon Hausmann
5f265ffc09 Split up ComponentWindow::run() into show(), hide() and sixtyfps::run_event_loop()
This allows creating multiple windows for example, and it will allow for
showing windows in those tests that require a mapped window.

As a bonus, the run() function on generated components is not consuming
anymore.
2021-01-19 09:50:22 +01:00
Olivier Goffart
63a0d9308b Bump version 2020-12-14 08:49:54 +01:00
Simon Hausmann
87e0cc7d85 Fix resource embedding doing a wasm build of a project using the sixtyfps! macro
We need to embed resources in wasm builds. Unfortunately we can't detect
that we're called by say wasm-pack and "TARGET"/"HOST" only works inside
build.rs. So instead, to keep things simple, this change always embeds
the image resources when targeting Rust.

The `SIXTYFPS_EMBED_RESOURCES` environment variable can be used to
override this anywhere for any language.

Fixes #130
2020-12-10 15:09:32 +01:00
Olivier Goffart
125ec13f24 Bump version numbers
Note: this does not update the documentation yet
2020-12-07 15:41:29 +01:00
Simon Hausmann
c258a907f0 Simplify event loop start-up
Move the layout constraint tracker into the window where we can apply
the constraints right before drawing, instead of doing that from within
the event loop. This allows to remove the component parameter from the
run function.
2020-11-12 15:04:48 +01:00
Simon Hausmann
5d744c86c2 Begin passing the VRC<ComponentVTable, Dyn> into the run-time library
First by changing the signature of run() and by adding a self_weak
to the C++ struct.
2020-11-11 18:31:51 +01:00
Simon Hausmann
02904c4014 Simplify signature of Component::run
We don't need to pass the root item anymore since ComponentVTable
has now get_item_ref.
2020-11-11 15:55:03 +01:00
Olivier Goffart
e4e7ae46f4 Support for for in box layout in the interpreter 2020-10-31 11:24:31 +01:00
Olivier Goffart
359f42c5f7 Prepare the compiler to be async
This will allow the online editor to load imports from URL asynchroniously later

Since currently the compiler is only working on a single thread, and that we
never await on a future that could block, it is allowed to use the spin_on executor
2020-10-30 15:00:04 +01:00
Olivier Goffart
20cfb65e53 Bump version 2020-10-22 08:41:45 +02:00
Olivier Goffart
d57ad389e0 Default to the native style in the viewer if it is available 2020-10-14 14:51:47 +02:00
Olivier Goffart
1138c9dbed Normalize the spelling of SixtyFPS 2020-10-13 07:48:55 +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
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
Olivier Goffart
d28e34eef6 Don't enable the display diagnostic feature in the interpreter 2020-08-26 19:12:28 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00