README.md 3.81 KB
Newer Older
Florian Blasius's avatar
Florian Blasius committed
1
<img alt="OrbTk" height="200" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/logos/orbtk/logo_dark.png">
Jeremy Soller's avatar
Jeremy Soller committed
2

Florian Blasius's avatar
Florian Blasius committed
3
[![Build status](https://gitlab.redox-os.org/redox-os/orbtk/badges/master/build.svg)](https://gitlab.redox-os.org/redox-os/orbtk/pipelines)
Jeremy Soller's avatar
Jeremy Soller committed
4
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
Florian Blasius's avatar
Florian Blasius committed
5
[![crates.io](https://img.shields.io/badge/crates.io-v0.2.27-orange.svg)](https://crates.io/crates/orbtk)
Jeremy Soller's avatar
Jeremy Soller committed
6
[![docs.rs](https://docs.rs/orbtk/badge.svg)](https://docs.rs/orbtk)
7

8 9
> OrbTk 0.3.0 is under heavy development and it's not compatible to earlier releases.

Florian Blasius's avatar
Florian Blasius committed
10
The Orbital Widget Toolkit is a multi platform (G)UI toolkit for building scalable user interfaces with the programming language Rust. It's based
11 12
on the [Entity Component System Pattern](https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80%93system) and provides a functional-reactive API. 

13
The main goals of OrbTk are fast peformance, easy to use and cross platform.
14

Florian Blasius's avatar
Florian Blasius committed
15
<img alt="Calculator" height="300" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Calculator.png">
Florian Blasius's avatar
Florian Blasius committed
16

Florian Blasius's avatar
Florian Blasius committed
17 18
## Features:

19
* Modern [Flutter](https://flutter.io/), [React](https://reactjs.org/), [Redux](https://redux.js.org/) like API
Florian Blasius's avatar
Florian Blasius committed
20
* Uses the Entity Component System library [DCES](https://gitlab.redox-os.org/redox-os/dces-rust) for widget and properties handling
Florian Blasius's avatar
Florian Blasius committed
21 22 23
* Updating instead of rebuling subtrees
* Flexible event system
* Widget state management
24
* Cross platform: Redox OS, Linux, macOS, Windows
25
* CSS theming
Florian Blasius's avatar
Florian Blasius committed
26

27 28
## Usage

Florian Blasius's avatar
Florian Blasius committed
29
To include OrbTk in your project, just add the dependency
30 31 32
line to your `Cargo.toml` file:

```text
Florian Blasius's avatar
Florian Blasius committed
33
orbtk = "0.2.27"
34 35
```

Florian Blasius's avatar
Florian Blasius committed
36
To use OrbTk 0.3, just add the dependency
Florian Blasius's avatar
Florian Blasius committed
37 38 39
line to your `Cargo.toml` file:

```text
Florian Blasius's avatar
Florian Blasius committed
40
orbtk = { git = https://gitlab.redox-os.org/redox-os/orbtk.git }
Florian Blasius's avatar
Florian Blasius committed
41 42
```

43 44 45 46
However you also need to have the SDL2 libraries installed on your
system.  The best way to do this is documented [by the SDL2
crate](https://github.com/AngryLawyer/rust-sdl2#user-content-requirements).

47 48 49 50 51 52 53 54 55
## Minimal Example

```rust
extern crate orbtk;
use orbtk::*;

struct MainView;

impl Widget for MainView {
56 57
    fn create() -> Template {
        Template::default()
58
            .as_parent_type(ParentType::Single)
59 60 61 62 63
            .with_child(
                Container::create()
                    .as_parent_type(ParentType::Single)
                    .with_child(TextBlock::create().with_property(Label::from("OrbTk"))),
            )
64 65 66 67 68 69 70 71 72
    }
}

fn main() {
    let mut application = Application::default();
    application
        .create_window()
        .with_bounds(Rect::new(0, 0, 420, 730))
        .with_title("Orbtk")
73
        .with_root(MainView::create())
74 75 76 77
        .build();
    application.run();
}
```
Keith Wade's avatar
Keith Wade committed
78

79
## Additional Examples
80 81 82

You find the examples in the `examples/` directory.

Florian Blasius's avatar
Florian Blasius committed
83
You can start the widgets example by executing the following command:
84 85

```text
86 87 88 89 90 91 92 93 94
cargo run --example widgets --release
```

## Build and run documenation

You can build and run the latest documentation y executing the following command:

```text
cargo doc --no-deps --open
Keith Wade's avatar
Keith Wade committed
95
```
Keith Wade's avatar
Keith Wade committed
96

97
## Planned features
Florian Blasius's avatar
Florian Blasius committed
98 99 100 101 102 103 104 105 106

* Style guide
* More default widgets
* More examples
* Book
* Animations
* Exchange views / widgets / screens on runtime
* Split application in modules
* Theme update
Florian Blasius's avatar
Florian Blasius committed
107
* Support for Android, iOS and WebAssembly
Florian Blasius's avatar
Florian Blasius committed
108
* Vulkan / OpenGL Support 
Florian Blasius's avatar
Florian Blasius committed
109

110 111 112 113 114 115 116 117
## Dependencies

* [OrbClient](https://gitlab.redox-os.org/redox-os/orbclient): window creation, drawing, window events
* [OrbFont](https://gitlab.redox-os.org/redox-os/orbfont): font rendering
* [OrbImage](https://gitlab.redox-os.org/redox-os/orbimage/tree/master/src): image loading
* [DCES](https://gitlab.redox-os.org/redox-os/dces-rust): Entity Component System
* [rust-cssparser](https://github.com/servo/rust-cssparser): CSS parsing

Florian Blasius's avatar
Florian Blasius committed
118 119 120 121 122 123
## Inspirations

* [Flutter](https://flutter.io/)
* [React](https://reactjs.org/)
* [Yew](https://github.com/DenisKolodin/yew)