Update `README` and `ROADMAP` and add `ECOSYSTEM`
|
@ -0,0 +1,88 @@
|
|||
# Ecosystem
|
||||
This document describes the Iced ecosystem.
|
||||
|
||||
It quickly lists the different audiences of the library and explains how the different crates relate to each other.
|
||||
|
||||
## Users
|
||||
|
||||
Iced is meant to be used by 2 different types of users:
|
||||
|
||||
- __End-users__. They should be able to:
|
||||
- get started quickly,
|
||||
- have many widgets available,
|
||||
- keep things simple,
|
||||
- and build applications that are __maintainable__ and __performant__.
|
||||
- __GUI toolkit developers / Ecosystem contributors__. They should be able to:
|
||||
- build new kinds of widgets,
|
||||
- implement custom runtimes,
|
||||
- integrate existing runtimes in their own system (like game engines),
|
||||
- and create their own custom renderers.
|
||||
|
||||
## Crates
|
||||
Iced consists of different crates which offer different layers of abstractions for our users. This modular architecture helps us keep implementation details hidden and decoupled, which should allow us to rewrite or change strategies in the future.
|
||||
|
||||
![Ecosystem graph](docs/graphs/ecosystem.png)
|
||||
|
||||
### [`iced_core`]
|
||||
|
||||
[`iced_core`] holds basic reusable types of the public API. For instance, basic data types like `Point`, `Rectangle`, `Length`, etc.
|
||||
|
||||
This crate is meant to be a starting point for an Iced runtime.
|
||||
|
||||
### [`iced_native`]
|
||||
[`iced_native`] takes [`iced_core`] and builds a native runtime on top of it, featuring:
|
||||
- A custom layout engine, greatly inspired by [`druid`]
|
||||
- Event handling for all the built-in widgets
|
||||
- A renderer-agnostic API
|
||||
|
||||
To achieve this, it introduces a bunch of reusable interfaces:
|
||||
- A `Widget` trait, which is used to implement new widgets: from layout requirements to event and drawing logic.
|
||||
- A bunch of `Renderer` traits, meant to keep the crate renderer-agnostic.
|
||||
- A `Windowed` trait, leveraging [`raw-window-handle`], which can be implemented by graphical renderers that target _windows_. Window-based shells (like [`iced_winit`]) can use this trait to stay renderer-agnostic.
|
||||
|
||||
[`druid`]: https://github.com/xi-editor/druid
|
||||
[`raw-window-handle`]: https://github.com/rust-windowing/raw-window-handle
|
||||
|
||||
### [`iced_web`]
|
||||
[`iced_web`] takes [`iced_core`] and builds a WebAssembly runtime on top. It achieves this by introducing a `Widget` trait that can be used to produce VDOM nodes.
|
||||
|
||||
The crate is currently a simple abstraction layer over [`dodrio`].
|
||||
|
||||
[`dodrio`]: https://github.com/fitzgen/dodrio
|
||||
|
||||
### [`iced_wgpu`]
|
||||
[`iced_wgpu`] is a [`wgpu`] renderer for [`iced_native`]. For now, it is the default renderer of Iced in native platforms.
|
||||
|
||||
[`wgpu`] supports most modern graphics backends: Vulkan, Metal, DX11, and DX12 (OpenGL and WebGL are still WIP). Additionally, it will support the incoming [WebGPU API].
|
||||
|
||||
Currently, [`iced_wgpu`] supports the following primitives:
|
||||
- Text, which is rendered using [`wgpu_glyph`]. No shaping at all.
|
||||
- Quads or rectangles, with rounded borders and a solid background color.
|
||||
- Images, lazily loaded from the filesystem.
|
||||
- Clip areas, useful to implement scrollables or hide overflowing content.
|
||||
|
||||
[`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
||||
[WebGPU API]: https://gpuweb.github.io/gpuweb/
|
||||
[`wgpu_glyph`]: https://github.com/hecrj/wgpu_glyph
|
||||
|
||||
### [`iced_winit`]
|
||||
[`iced_winit`] offers some convenient abstractions on top of [`iced_native`] to quickstart development when using [`winit`].
|
||||
|
||||
It exposes a renderer-agnostic `Application` trait that can be implemented and then run with a simple call. The use of this trait is optional. A `conversion` module is provided for users that decide to implement a custom event loop.
|
||||
|
||||
[`winit`]: https://github.com/rust-windowing/winit
|
||||
|
||||
### [`iced`]
|
||||
Finally, [`iced`] unifies everything into a simple abstraction to create cross-platform applications:
|
||||
|
||||
- On native, it uses [`iced_winit`] and [`iced_wgpu`].
|
||||
- On the web, it uses [`iced_web`].
|
||||
|
||||
This is the crate meant to be used by __end-users__.
|
||||
|
||||
[`iced_core`]: core
|
||||
[`iced_native`]: native
|
||||
[`iced_web`]: web
|
||||
[`iced_wgpu`]: wgpu
|
||||
[`iced_winit`]: winit
|
||||
[`iced`]: ..
|
96
README.md
|
@ -3,8 +3,9 @@
|
|||
[![Documentation](https://docs.rs/iced/badge.svg)][documentation]
|
||||
[![Crates.io](https://img.shields.io/crates/v/iced.svg)](https://crates.io/crates/iced)
|
||||
[![License](https://img.shields.io/crates/l/iced.svg)](https://github.com/hecrj/iced/blob/master/LICENSE)
|
||||
[![project chat](https://img.shields.io/badge/chat-on_zulip-brightgreen.svg)](https://iced.zulipchat.com)
|
||||
|
||||
A renderer-agnostic GUI library for Rust focused on simplicity and type-safety.
|
||||
A cross-platform GUI library for Rust focused on simplicity and type-safety.
|
||||
Inspired by [Elm].
|
||||
|
||||
[![Tour - Iced][gui_gif]][gui_gfycat]
|
||||
|
@ -17,15 +18,31 @@ Inspired by [Elm].
|
|||
[coffee_gui_gfycat]: https://gfycat.com/gloomyweakhammerheadshark
|
||||
|
||||
## Features
|
||||
* Simple, easy-to-use, renderer-agnostic API
|
||||
* Responsive, flexbox-based layouting
|
||||
* Simple, easy-to-use, batteries-included API
|
||||
* Type-safe, reactive programming model
|
||||
* Built-in widgets
|
||||
* Custom widget support
|
||||
* Cross-platform support (Windows, macOS, Linux, and the Web)
|
||||
* Responsive layout
|
||||
* Built-in widgets (including [text inputs], [scrollables], and more!)
|
||||
* Custom widget support (create your own!)
|
||||
* [Debug overlay with performance metrics]
|
||||
* First-class support for async actions (use futures!)
|
||||
* [Modular ecosystem] split into reusable parts:
|
||||
* A [default renderer] supporting Vulkan, Metal, DX11, and DX12
|
||||
* A [renderer-agnostic native runtime] enabling integration with existing systems
|
||||
* A [web runtime] leveraging the DOM
|
||||
|
||||
__Iced is in a experimental stage.__ [Take a look at the roadmap],
|
||||
[check out the issues], and [feel free to contribute!].
|
||||
__Iced is currently experimental software.__ [Take a look at the roadmap],
|
||||
[check out the issues], and [feel free to contribute!]
|
||||
|
||||
[text inputs]: https://gfycat.com/alertcalmcrow-rust-gui
|
||||
[scrollables]: https://gfycat.com/perkybaggybaboon-rust-gui
|
||||
[Debug overlay with performance metrics]: https://gfycat.com/artisticdiligenthorseshoebat-rust-gui
|
||||
[Modular ecosystem]: https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md
|
||||
[renderer-agnostic native runtime]: https://github.com/hecrj/iced/tree/master/native
|
||||
[`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
||||
[Default renderer]: https://github.com/hecrj/iced/tree/master/wgpu
|
||||
[`dodrio`]: https://github.com/fitzgen/dodrio
|
||||
[web runtime]: https://github.com/hecrj/iced/tree/master/web
|
||||
[Take a look at the roadmap]: https://github.com/hecrj/iced/blob/master/ROADMAP.md
|
||||
[check out the issues]: https://github.com/hecrj/iced/issues
|
||||
[feel free to contribute!]: #contributing--feedback
|
||||
|
@ -139,7 +156,7 @@ to:
|
|||
1. Take the result of our __view logic__ and layout its widgets.
|
||||
1. Process events from our system and produce __messages__ for our
|
||||
__update logic__.
|
||||
1. Draw the resulting user interface using our chosen __renderer__.
|
||||
1. Draw the resulting user interface.
|
||||
|
||||
Browse the [documentation] and the [examples] to learn more!
|
||||
|
||||
|
@ -147,40 +164,51 @@ Browse the [documentation] and the [examples] to learn more!
|
|||
Iced was originally born as an attempt at bringing the simplicity of [Elm] and
|
||||
[The Elm Architecture] into [Coffee], a 2D game engine I am working on.
|
||||
|
||||
The core of the library was implemented during May in [this pull request], using
|
||||
[`stretch`] for flexbox-based layouting. It was later released as the main
|
||||
feature of [Coffee 0.3.0].
|
||||
The core of the library was implemented during May in [this pull request].
|
||||
[The first alpha version] was eventually released as
|
||||
[a renderer-agnostic GUI library]. The library did not provide a renderer and
|
||||
implemented the current [tour example] on top of [`ggez`], a game library.
|
||||
|
||||
After release, different folks suggested me to split the new [`ui` module] into
|
||||
its own standalone crate, as it could potentially benefit other engines and
|
||||
applications. I thought it was a great idea, and after a bit of work... Iced is
|
||||
here!
|
||||
Since then, the focus has shifted towards providing a batteries-included,
|
||||
end-user-oriented GUI library, while keeping [the ecosystem] modular.
|
||||
|
||||
Iced consists of different crates which offer different layers of abstractions
|
||||
for our users. This modular architecture helps us keep implementation details
|
||||
hidden and decoupled, which should allow us to rewrite or change strategies in
|
||||
the future.
|
||||
Currently, Iced is a cross-platform GUI library built on top of smaller crates:
|
||||
|
||||
![Iced ecosystem](https://github.com/hecrj/iced/raw/master/docs/crates_graph.png)
|
||||
- [`iced_core`], a bunch of basic types that can be reused in different runtimes.
|
||||
- [`iced_native`], a renderer-agnostic native runtime implementing widget
|
||||
logic and a layout engine inspired by [`druid`].
|
||||
- [`iced_web`], an experimental web runtime that targets the DOM thanks to
|
||||
[`dodrio`].
|
||||
- [`iced_wgpu`], a renderer leveraging [`wgpu`], [`wgpu_glyph`], and
|
||||
[`font-kit`].
|
||||
- [`iced_winit`], a windowing shell on top of [`winit`].
|
||||
|
||||
Read [the roadmap] if you want to learn more!
|
||||
[![Iced ecosystem](docs/graphs/ecosystem.png)](https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md)
|
||||
|
||||
[this pull request]: https://github.com/hecrj/coffee/pull/35
|
||||
[`stretch`]: https://github.com/vislyhq/stretch
|
||||
[Coffee 0.3.0]: https://github.com/hecrj/coffee/releases/tag/0.3.0
|
||||
[`ui` module]: https://docs.rs/coffee/0.3.2/coffee/ui/index.html
|
||||
[the roadmap]: https://github.com/hecrj/iced/blob/master/ROADMAP.md
|
||||
[The first alpha version]: https://github.com/hecrj/iced/tree/0.1.0-alpha
|
||||
[a renderer-agnostic GUI library]: https://www.reddit.com/r/rust/comments/czzjnv/iced_a_rendereragnostic_gui_library_focused_on/
|
||||
[tour example]: https://github.com/hecrj/iced/blob/master/examples/tour.rs
|
||||
[`ggez`]: https://github.com/ggez/ggez
|
||||
[the ecosystem]: https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md
|
||||
[`iced_core`]: https://github.com/hecrj/iced/tree/master/core
|
||||
[`iced_native`]: https://github.com/hecrj/iced/tree/master/native
|
||||
[`iced_web`]: https://github.com/hecrj/iced/tree/master/web
|
||||
[`iced_wgpu`]: https://github.com/hecrj/iced/tree/master/wgpu
|
||||
[`iced_winit`]: https://github.com/hecrj/iced/tree/master/winit
|
||||
[`druid`]: https://github.com/xi-editor/druid
|
||||
[`wgpu_glyph`]: https://github.com/hecrj/wgpu_glyph
|
||||
[`font-kit`]: https://github.com/servo/font-kit
|
||||
[`winit`]: https://github.com/rust-windowing/winit
|
||||
|
||||
## Contributing / Feedback
|
||||
If you want to contribute, you are more than welcome to be a part of the
|
||||
project! Check out [the roadmap] and [the current issues] if you want to find
|
||||
something to work on. Try to share you thoughts first! Feel free to open a new
|
||||
issue if you want to discuss new ideas.
|
||||
Contributions are greatly appreciated! If you want to contribute, please
|
||||
read our [contributing guidelines] for more details.
|
||||
|
||||
Any kind of feedback is welcome! You can open an issue or, if you want to talk,
|
||||
you can find me (and a bunch of awesome folks) over the `#games-and-graphics`
|
||||
and `#gui-and-ui` channels in the [Rust Community Discord]. I go by
|
||||
`@lone_scientist` there.
|
||||
Feedback is also welcome! You can open an issue or, if you want to talk,
|
||||
come chat to our [Zulip server]. Moreover, you can find me (and a bunch of
|
||||
awesome folks) over the `#games-and-graphics` and `#gui-and-ui` channels in
|
||||
the [Rust Community Discord]. I go by `lone_scientist#9554` there.
|
||||
|
||||
[documentation]: https://docs.rs/iced
|
||||
[examples]: https://github.com/hecrj/iced/tree/master/examples
|
||||
|
@ -188,4 +216,6 @@ and `#gui-and-ui` channels in the [Rust Community Discord]. I go by
|
|||
[Elm]: https://elm-lang.org/
|
||||
[The Elm Architecture]: https://guide.elm-lang.org/architecture/
|
||||
[the current issues]: https://github.com/hecrj/iced/issues
|
||||
[contributing guidelines]: https://github.com/hecrj/iced/blob/master/CONTRIBUTING.md
|
||||
[Zulip server]: https://iced.zulipchat.com/
|
||||
[Rust Community Discord]: https://bit.ly/rust-community
|
||||
|
|
193
ROADMAP.md
|
@ -1,149 +1,21 @@
|
|||
# Roadmap
|
||||
This document describes the current state of Iced and some of the most important next steps we should take before it can become a production-ready GUI library.
|
||||
|
||||
## Context
|
||||
Before we get into the actual roadmap, let's quickly review what is the current state of the library.
|
||||
|
||||
### Users
|
||||
|
||||
Iced is meant to be used by 2 different types of users:
|
||||
|
||||
- __End-users__. They should be able to:
|
||||
- get started quickly,
|
||||
- have many widgets available,
|
||||
- keep things simple,
|
||||
- and build applications that are __maintainable__ and __performant__.
|
||||
- __GUI toolkit developers / Ecosystem contributors__. They should be able to:
|
||||
- build new kinds of widgets,
|
||||
- implement custom runtimes,
|
||||
- integrate existing runtimes in their own system (like game engines),
|
||||
- and create their own custom renderers.
|
||||
|
||||
### Current state
|
||||
Iced consists of different crates which offer different layers of abstractions for our users. This modular architecture helps us keep implementation details hidden and decoupled, which should allow us to rewrite or change strategies in the future.
|
||||
|
||||
![Crates graph](docs/crates_graph.png)
|
||||
|
||||
#### `iced_core`
|
||||
|
||||
`iced_core` holds most of the reusable types of the public API. For instance, common widgets (like `Column`, `Row`, `Button`...) and basic data types (`Point`, `Rectangle`, `Length`...).
|
||||
|
||||
This crate is meant to be a starting point for an Iced runtime.
|
||||
|
||||
#### `iced_native`
|
||||
`iced_native` takes `iced_core` and builds a native runtime on top of it, featuring:
|
||||
- A flexbox-based layout engine, powered by [`stretch`]
|
||||
- Event handling for all the built-in widgets
|
||||
- A renderer-agnostic API
|
||||
|
||||
To achieve this, it introduces a bunch of reusable interfaces:
|
||||
- A `Widget` trait, which is used to implement new widgets: from layout requirements to event and drawing logic.
|
||||
- A bunch of `Renderer` traits, meant to keep the crate renderer-agnostic.
|
||||
- A `Windowed` trait, which can be implemented by graphical renderers that target _windows_. Window-based runtimes can use this trait to stay renderer-agnostic.
|
||||
|
||||
[`stretch`]: https://github.com/vislyhq/stretch
|
||||
|
||||
#### `iced_web`
|
||||
`iced_web` takes `iced_core` and builds a WebAssembly runtime on top. It achieves this by introducing a `Widget` trait that can be used to produce VDOM nodes.
|
||||
|
||||
The crate is a quite simple abstraction layer over [`dodrio`].
|
||||
|
||||
[`dodrio`]: https://github.com/fitzgen/dodrio
|
||||
|
||||
#### `iced_wgpu`
|
||||
`iced_wgpu` is a [`wgpu`] renderer for `iced_native`. It is meant to become the default renderer of Iced in native platforms.
|
||||
|
||||
[`wgpu`] supports most modern graphics backends: Vulkan, Metal, DX11, and DX12 (OpenGL and WebGL are still WIP). Additionally, it will support the incoming [WebGPU API].
|
||||
|
||||
Currently, `iced_wgpu` only supports a couple of primitives:
|
||||
- Text, which is rendered using [`wgpu_glyph`].
|
||||
- Quads or rectangles, with rounded borders and a solid background color.
|
||||
|
||||
[`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
||||
[WebGPU API]: https://gpuweb.github.io/gpuweb/
|
||||
[`wgpu_glyph`]: https://github.com/hecrj/wgpu_glyph
|
||||
|
||||
#### `iced_winit`
|
||||
`iced_winit` offers some convenient abstractions on top of `iced_native` to quickstart development when using [`winit`].
|
||||
|
||||
It exposes a renderer-agnostic `Application` trait that can be implemented and then run with a simple call. The use of this trait is optional. A `conversion` module is provided for users that decide to implement a custom event loop.
|
||||
|
||||
[`winit`]: https://github.com/rust-windowing/winit
|
||||
|
||||
#### `iced`
|
||||
Finally, `iced` unifies everything into a simple abstraction to create cross-platform applications:
|
||||
|
||||
- On native, it uses `iced_winit` and `iced_wgpu`.
|
||||
- On the web, it uses `iced_web`.
|
||||
|
||||
This is the crate meant to be used by __end-users__.
|
||||
|
||||
This document describes the current state of Iced and some of the most important next steps we should take before it can become a production-ready GUI library. This list keeps the short term new features in sight in order to coordinate work. Therefore, it is not meant to be exhaustive.
|
||||
|
||||
## Next steps
|
||||
This section describes some important features that should be implemented before Iced can be considered production-ready (before a 1.0 release).
|
||||
|
||||
Most of the work related to these features needs to happen in the `iced_native` path of the ecosystem, as the web already supports many of them.
|
||||
|
||||
### Scrollables / Clippables ([#24])
|
||||
Content that can take a (practically) infinite amount of space and can be viewed using a scrollbar. This is a very basic feature.
|
||||
Once a step is completed, it is collapsed and added to this list:
|
||||
|
||||
The end-user API could look like this:
|
||||
|
||||
```rust
|
||||
Column::new()
|
||||
.push(content)
|
||||
.scroll(&mut self.scroll_state);
|
||||
```
|
||||
|
||||
The challenge here is __composability__. Nested scrollables should work as expected.
|
||||
|
||||
When it comes to `iced_native`, we may need to add the concept of _event propagation_, so mouse wheel events can be captured by the inner-most scrollable and stop propagation.
|
||||
|
||||
When it comes to `iced_wgpu`, we should be able to use scissoring and transformations. [`wgpu`] has a [`RenderPass::set_scissor_rect`] that should work nicely.
|
||||
|
||||
The main issue here will be [`wgpu_glyph`], which is used currently to render text primitives. [`wgpu_glyph`] is powered by [`glyph-brush`], which caches glyphs to render text very fast. However, the current cache model does not seem to be composable (i.e. once you issue a draw call the cache is purged). We will need to change it (and potentially contribute) to accommodate for this use case.
|
||||
* [x] Scrollables / Clippables ([#24])
|
||||
* [x] Text input widget ([#25])
|
||||
* [x] TodoMVC example ([#26])
|
||||
* [x] Async actions ([#27])
|
||||
* [x] Custom layout engine
|
||||
|
||||
[#24]: https://github.com/hecrj/iced/issues/24
|
||||
[`RenderPass::set_scissor_rect`]: https://docs.rs/wgpu/0.3.0/src/wgpu/lib.rs.html#1246-1248
|
||||
[`glyph-brush`]: https://github.com/alexheretic/glyph-brush
|
||||
|
||||
### Text input widget ([#25])
|
||||
A widget where the user can type raw text and passwords.
|
||||
|
||||
This widget will have a quite complex event logic, potentially coupled with text rendering. Some examples are:
|
||||
- Text cursor positioning based on a mouse click
|
||||
- Text selection
|
||||
- Clipboard interaction (copy & paste)
|
||||
- Text editing shortcuts (go to start, go to end, etc.)
|
||||
|
||||
It also needs scrollable / clippable text support, as the introduced text may not fit the input and scrolling based on the text cursor will need to be implemented.
|
||||
|
||||
Additionally, the text cursor should blink at a regular interval, which can be considered an _animation_.
|
||||
|
||||
I think we should start simple here, and build a text widget with the most basic functionality: click to focus and type to fill. We can improve the implementation with time as the library matures.
|
||||
|
||||
The end-user API could look like this:
|
||||
|
||||
```rust
|
||||
pub enum Message {
|
||||
TextChanged(String),
|
||||
}
|
||||
|
||||
let text_input = text_input::State::new();
|
||||
let text = "Hello";
|
||||
|
||||
TextInput::new(&mut text_input, &text, Message::TextChanged);
|
||||
```
|
||||
|
||||
[#25]: https://github.com/hecrj/iced/issues/25
|
||||
|
||||
### TodoMVC example ([#26])
|
||||
Once we have scrollables support and a text widget, we could build a [TodoMVC] example. It seems to be a very simple example and could showcase the API quite well.
|
||||
|
||||
We could also consider releasing a `0.1.0` version at this point and share it as a milestone on different social platforms.
|
||||
|
||||
[#26]: https://github.com/hecrj/iced/issues/26
|
||||
[TodoMVC]: http://todomvc.com/
|
||||
[#28]: https://github.com/hecrj/iced/issues/28
|
||||
|
||||
### Multi-window support ([#27])
|
||||
Open and control multiple windows at runtime.
|
||||
|
@ -154,46 +26,6 @@ This approach should also allow us to perform custom optimizations for this part
|
|||
|
||||
[#27]: https://github.com/hecrj/iced/issues/27
|
||||
|
||||
### Async actions ([#28])
|
||||
Most applications need to perform work in the background, without freezing the UI while they work. The current architecture can be easily extended to achieve this.
|
||||
|
||||
We can let users return an asynchronous action (i.e. a future) producing a `Message` in `Application::update`. The runtime will spawn each returned action in a thread pool and, once it finishes, feed the produced message back to `update`. This is also how [Elm] does it.
|
||||
|
||||
When it comes to implementing this, [`winit`] already supports user-specific events that can be sent from another thread. Accommodating `iced_winit` for this functionality should not be too complicated.
|
||||
|
||||
[Elm]: https://elm-lang.org/
|
||||
|
||||
Here is an example of how the end-user API could look:
|
||||
|
||||
```rust
|
||||
impl Application for WeatherReport {
|
||||
fn update(&mut self, message: Message) -> Command<Message> {
|
||||
match message {
|
||||
Message::Refresh => {
|
||||
self.state = State::Loading;
|
||||
|
||||
Command::from_future(
|
||||
Weather::request(self.location),
|
||||
Message::ReportReceived,
|
||||
)
|
||||
}
|
||||
Message::ReportReceived(Ok(report)) => {
|
||||
self.state = State::Show(report);
|
||||
|
||||
Command::none()
|
||||
},
|
||||
Message::ReportReceived(Err(error)) => {
|
||||
self.state = State::Error(error);
|
||||
|
||||
Command::none()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[#28]: https://github.com/hecrj/iced/issues/28
|
||||
|
||||
### Event subscriptions ([#29])
|
||||
Besides performing async actions on demand, most applications also need to listen to events passively. An example of this could be a WebSocket connection, where messages can come in at any time.
|
||||
|
||||
|
@ -233,7 +65,7 @@ In the long run, we could expose a renderer-agnostic abstraction to perform the
|
|||
[#32]: https://github.com/hecrj/iced/issues/32
|
||||
|
||||
### Text shaping and font fallback ([#33])
|
||||
[`wgpu_glyph`] uses [`glyph-brush`], which in turn uses [`rusttype`]. While the current implementation is able to layout text quite nicely, it does not perform any [text shaping].
|
||||
[`wgpu_glyph`] uses [`glyph_brush`], which in turn uses [`rusttype`]. While the current implementation is able to layout text quite nicely, it does not perform any [text shaping].
|
||||
|
||||
[Text shaping] with font fallback is a necessary feature for any serious GUI toolkit. It unlocks support to truly localize your application, supporting many different scripts.
|
||||
|
||||
|
@ -303,5 +135,8 @@ This could be very useful to build very performant user interfaces with a lot of
|
|||
|
||||
[Elm does it very well!](https://guide.elm-lang.org/optimization/lazy.html)
|
||||
|
||||
### Build a custom layout engine
|
||||
It may be possible to build an optimized layout engine only for `iced_native` if it turns out that there are some flexbox features we end up not using.
|
||||
[Elm]: https://elm-lang.org/
|
||||
[`winit`]: https://github.com/rust-windowing/winit
|
||||
[`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
||||
[`wgpu_glyph`]: https://github.com/hecrj/wgpu_glyph
|
||||
[`glyph_brush`]: https://github.com/alexheretic/glyph-brush
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
digraph G {
|
||||
"iced_core" -> "iced_native"
|
||||
"iced_core" -> "iced_web"
|
||||
"iced_native" -> "iced_wgpu"
|
||||
"iced_native" -> "iced_winit"
|
||||
"iced_web" -> "iced"
|
||||
"iced_wgpu" -> "iced"
|
||||
"iced_winit" -> "iced"
|
||||
|
||||
node[shape=box];
|
||||
"iced" -> "cross-platform application"
|
||||
}
|
Before Width: | Height: | Size: 39 KiB |
|
@ -0,0 +1,13 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
{ rank = same; iced_native iced_web }
|
||||
|
||||
iced_core -> iced_native [style=dashed];
|
||||
iced_core -> iced_web [style=dashed];
|
||||
|
||||
iced_core [style=dashed, fontcolor=black];
|
||||
|
||||
}
|
After Width: | Height: | Size: 16 KiB |
|
@ -0,0 +1,59 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
subgraph cluster_1 {
|
||||
label = "renderers ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_1 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_wgpu;
|
||||
}
|
||||
|
||||
subgraph cluster_2 {
|
||||
label = "shells ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_2 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_winit;
|
||||
}
|
||||
|
||||
subgraph cluster_3 {
|
||||
style=invis;
|
||||
margin=20;
|
||||
iced;
|
||||
}
|
||||
|
||||
{ rank = same; iced_native iced_web }
|
||||
{ rank = same; iced_wgpu iced_winit etc_1 etc_2 }
|
||||
|
||||
iced_core -> iced_native [style=dashed];
|
||||
iced_core -> iced_web [style=dashed];
|
||||
iced_native -> iced_wgpu;
|
||||
iced_native -> iced_winit;
|
||||
|
||||
iced_winit -> iced;
|
||||
iced_wgpu -> iced;
|
||||
iced_web -> iced;
|
||||
|
||||
iced -> "cross-platform application";
|
||||
|
||||
iced_core [style=dashed, fontcolor=black];
|
||||
iced [width=1, height=0.6, style="filled", fontcolor=white, color="#474973"];
|
||||
|
||||
|
||||
"cross-platform application" [shape=box3d, style="solid", width=2.8, height=0.6, fontcolor="#474973"];
|
||||
}
|
After Width: | Height: | Size: 51 KiB |
|
@ -0,0 +1,47 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
subgraph cluster_1 {
|
||||
label = "renderers ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_1 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_wgpu;
|
||||
}
|
||||
|
||||
subgraph cluster_2 {
|
||||
label = "shells ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_2 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_winit;
|
||||
}
|
||||
|
||||
subgraph cluster_3 {
|
||||
style=invis;
|
||||
margin=20;
|
||||
iced;
|
||||
}
|
||||
|
||||
{ rank = same; iced_wgpu iced_winit etc_1 etc_2 }
|
||||
|
||||
iced_winit -> iced;
|
||||
iced_wgpu -> iced;
|
||||
iced_web -> iced;
|
||||
|
||||
iced [width=1, height=0.6, style="filled", fontcolor=white, color="#474973"];
|
||||
}
|
After Width: | Height: | Size: 32 KiB |
|
@ -0,0 +1,42 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
subgraph cluster_1 {
|
||||
label = "renderers ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_1 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_wgpu;
|
||||
}
|
||||
|
||||
subgraph cluster_2 {
|
||||
label = "shells ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_2 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_winit;
|
||||
}
|
||||
|
||||
|
||||
{ rank = same; iced_wgpu iced_winit etc_1 etc_2 }
|
||||
|
||||
iced_core -> iced_native [style=dashed];
|
||||
iced_native -> iced_wgpu;
|
||||
iced_native -> iced_winit;
|
||||
|
||||
iced_core [style=dashed, fontcolor=black];
|
||||
}
|
After Width: | Height: | Size: 27 KiB |
|
@ -0,0 +1,12 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
iced_core -> iced_web [style=dashed];
|
||||
|
||||
iced_web -> iced;
|
||||
|
||||
iced_core [style=dashed, fontcolor=black];
|
||||
iced [width=1, height=0.6, style="filled", fontcolor=white, color="#474973"];
|
||||
}
|
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,33 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
subgraph cluster_1 {
|
||||
label = "renderers ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_1 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_wgpu;
|
||||
}
|
||||
|
||||
subgraph cluster_3 {
|
||||
style=invis;
|
||||
margin=20;
|
||||
iced;
|
||||
}
|
||||
|
||||
{ rank = same; iced_wgpu etc_1 }
|
||||
|
||||
iced_native -> iced_wgpu;
|
||||
|
||||
iced_wgpu -> iced;
|
||||
|
||||
iced [width=1, height=0.6, style="filled", fontcolor=white, color="#474973"];
|
||||
}
|
After Width: | Height: | Size: 20 KiB |
|
@ -0,0 +1,33 @@
|
|||
digraph G {
|
||||
fontname = "Roboto";
|
||||
newrank=true;
|
||||
node[fontname = "Roboto", style=filled, fontcolor=white, color="#474973"];
|
||||
|
||||
subgraph cluster_2 {
|
||||
label = "shells ";
|
||||
labelloc = "b";
|
||||
labeljust = "r";
|
||||
fontcolor = "#ffffff";
|
||||
color="#8797AF";
|
||||
bgcolor="#8797AF";
|
||||
style=rounded;
|
||||
node [fillcolor=white, color=white, fontcolor=black];
|
||||
|
||||
etc_2 [label="...", style=empty, shape=none, fontcolor=white];
|
||||
iced_winit;
|
||||
}
|
||||
|
||||
subgraph cluster_3 {
|
||||
style=invis;
|
||||
margin=20;
|
||||
iced;
|
||||
}
|
||||
|
||||
{ rank = same; iced_winit etc_2 }
|
||||
|
||||
iced_native -> iced_winit;
|
||||
|
||||
iced_winit -> iced;
|
||||
|
||||
iced [width=1, height=0.6, style="filled", fontcolor=white, color="#474973"];
|
||||
}
|
After Width: | Height: | Size: 17 KiB |