initial source markdown files

* SUMMARY.md: The book structure
* title-page.md
* forword.md
* ch00-*: Introduction
* ch01-*: Getting started
* ch02-*: OrbTK examples
* appendix-*: Appendix and external references
* img/ferries: referenced rust svg images

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-10-04 22:14:19 +02:00
parent 88233508fe
commit a96bb05eac
19 changed files with 757 additions and 0 deletions

21
src/SUMMARY.md Normal file
View File

@@ -0,0 +1,21 @@
# The Orbital Widget Toolkit
[The Orbtk Widget Toolkit](title-page.md)
[Foreword](foreword.md)
[Introduction](ch00-00-introduction.md)
## Getting started
- [Getting Started](ch01-00-getting-started.md)
- [Installation](ch01-01-installation.md)
- [Hello OrbTK!](ch01-02-hello-orbtk.md)
- [OrbTK examples](ch02-00-orbtk-examples.md)
- [Widgets](ch02-01-widgets.md)
- [Showcase](ch02-02-showcase.md)
- [Appendix](appendix-00.md)
- [A - Keywords](appendix-01-keywords.md)
- [B - Operators and Symbols](appendix-02-operators.md)
- [C - Derivable Traits](appendix-03-derivable-traits.md)
- [D - Translations of the Book](appendix-04-translation.md)

3
src/appendix-00.md Normal file
View File

@@ -0,0 +1,3 @@
# OrbTK Appendix
This is WIP

View File

@@ -0,0 +1,3 @@
# OrbTK Appendix - Keywords
This is WIP

View File

@@ -0,0 +1,3 @@
# OrbTK Appendix - Operators
This is WIP

View File

@@ -0,0 +1,3 @@
# OrbTK Appendix - Derivable Traits
This is WIP

View File

@@ -0,0 +1,15 @@
# Appendix D: Translations of the Book
For resources in languages other than English. Most are still in progress; see
[the Translations label][label] to help or let us know about a new translation!
[label]: https://github.com/redox-os/orbtk
- [Deutsch](https://github.com/redox-os/orbtk)
- [Français](https://github.com/redox-os/orbtk)
<!---
[label]: https://github.com/redox-os/orbtk/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
- [Deutsch](https://github.com/redox-os/orbtk/book-de)
- [Français](https://github.com/redox-os/orbtk/book-fr)
-->

154
src/ch00-00-introduction.md Normal file
View File

@@ -0,0 +1,154 @@
# Introduction
<!--
> WIP: to be uncommented, once it is done
> Note: This edition of the book is the same as [The Orbital Widget Toolkit]
> [nsprust] available in print and ebook format from [No Starch Press][nsporbtk].
[nsporbtk]: https://nostarch.com/orbtk
[nsp]: https://nostarch.com/
-->
Welcome to *The Orbital Widget Toolkit*, an introductory book about OrbTK.
The Rust programming language helps you write faster, more reliable software.
OrbTK contribute the needed crates, to develop modern graphical user interfaces.
It offers a single code base that compiles to native binary code that is executed
on your target platform.
## Features
* Modern lightweight API
* Cross platform
* Modular crates
* Based on Entity Component System library DCES
* Flexible event system
* Integrated widget library
* Custom widgets
* Custom theming engine
* Dynamic theme switching
* Integrated debugging tools
* Localization
## Supported Platforms
* Redox OS (native)
* Linux (native | cargo-node)
* macOS (native | cargo-node)
* Windows (native | cargo-node)
* openBSD (not tested, but should work)
* Web (cargo-node)
* Android (native planned | cargo-node)
* iOS (native planned | cargo-node planned)
* Ubuntu Touch (native planned | cargo-node planned)
## Who OrbTK Is For
OrbTK is ideal for programmers that like to take advantage of the Rust programming
language. No need to transform data structures and types: OrbTK itself is coded in
Rust. It naturally adopts all the structural advantages and provides the needed GUI
elements to code your application. Lets look at a few of
the most important groups.
### Teams of Developers
Rust is proving to be a productive tool for collaborating among large teams of
developers with varying levels of systems programming knowledge. Have a look at
the Rust book that elaborates the fundamental principles that enables you to
produce saver code.
OrbTK reuses the Rust toolchain as much as possible. Contemporary developer
that have passed the learning curve will take advantage of:
* Cargo, the included dependency manager and build tool, makes adding,
compiling, and managing dependencies painless and consistent across the Rust
ecosystem.
* Rustfmt ensures a consistent coding style across developers.
* The Rust Language Server powers Integrated Development Environment (IDE)
integration for code completion and inline error messages.
### Students
Rust is for students and those who are interested in learning about systems
concepts. Using Rust, many people have learned about topics like operating
systems development. The community is very welcoming and happy to answer
student questions. Through efforts such as this book, the Rust teams want to
make systems concepts more accessible to more people, especially those new to
programming.
### Companies
Hundreds of companies, large and small, use Rust in production for a variety of
tasks. Those tasks include command line tools, web services, DevOps tooling,
embedded devices, audio and video analysis and transcoding, cryptocurrencies,
bioinformatics, search engines, Internet of Things applications, machine
learning, and even major parts of the Firefox web browser.
### Open Source Developers
OrbTK is for people who want to build with the Rust programming language,
its community, its developer tools, and libraries. Wed love to have you
contribute to its crates and entities.
## Who This Book Is For
This book assumes that youve written code in another programming language
and other GUI toolkits. We do not make any assumptions about which specific
one. Weve tried to make the material broadly accessible to those from a
wide variety of development backgrounds. We dont spend a lot of time
talking about what programming *is* or how to think about it.
If youre entirely new to programming, you would be better served by
reading a book that specifically provides an introduction to programming.
## How to Use This Book
In general, this book assumes that youre reading it in sequence from front to
back. Later chapters build on concepts in earlier chapters, and earlier
chapters might not delve into details on a topic; we typically revisit the
topic in a later chapter.
Youll find two kinds of chapters in this book: concept chapters and project
chapters. In concept chapters, youll learn about an aspect of OrbTK. In project
chapters, well build small programs together, applying what youve learned so
far.
Chapter 1 explains how to install Rust and OrbTK, how to write minimal program,
and how to use Cargo, Rusts package manager and build tool.
Finally, some appendixes contain useful information about the in a
more reference-like format. Appendix A covers OrbTKs keywords, Appendix B
covers OrbTKs derivable traits and crates.
There is no wrong way to read this book: if you want to skip ahead, go for it!
You might have to jump back to earlier chapters if you experience any
confusion. But do whatever works for you.
<span id="ferris"></span>
An important part of the process of learning OrbTK is learning how to read the
error messages the compiler displays: these will guide you toward working code.
As such, well provide many examples that dont compile along with the error
message the compiler will show you in each situation. Know that if you enter
and run a random example, it may not compile! Make sure you read the
surrounding text to see whether the example youre trying to run is meant to
error. Ferris will also help you distinguish code that isnt meant to work:
| Ferris | Meaning |
|------------------------------------------------------------------------|--------------------------------------------------|
| <img src="img/ferris/does_not_compile.svg" class="ferris-explain"/> | This code does not compile! |
| <img src="img/ferris/panics.svg" class="ferris-explain"/> | This code panics! |
| <img src="img/ferris/unsafe.svg" class="ferris-explain"/> | This code block contains unsafe code. |
| <img src="img/ferris/not_desired_behavior.svg" class="ferris-explain"/>| This code does not produce the desired behavior. |
In most situations, well lead you to the correct version of any code that
doesnt compile.
## Source Code
The source files from which this book is generated can be found on
[GitHub][book].
[book]: https://github.com/redox-os/orbtk
<!---
[book]: https://github.com/redox-os/orbtk/book/tree/master/src
-->

View File

@@ -0,0 +1,8 @@
# Getting Started
Lets start your OrbTK journey! Theres a lot to learn, but every journey starts
somewhere. In this chapter, well discuss:
* Installing OrbTK on Linux, Bsd, macOS, and Windows.
* Writing a basic OrtTK application that opens a windows placing `Hello OrbTK!` in its center.
* Using `cargo`, Rusts package manager and build system.

View File

@@ -0,0 +1,30 @@
## Installation
The first step is to install Rust. This is described in depth following
[Rust book Chapter 1](https://github.com/rust-lang/book/blob/master/src/ch01-01-installation.md)
When creating a OrbTK application, we define the needed dependencies to the
OrbTK crates in the Cargo.toml file of our project. The complile process
will resolve the references and download the source as needed.
> ### Command Line Notation
>
> In this chapter and throughout the book, well show some commands used in the
> terminal. Lines that you should enter in a terminal all start with `$`. You
> dont need to type in the `$` character; it indicates the start of each
> command. Lines that dont start with `$` typically show the output of the
> previous command. Additionally, PowerShell-specific examples will use `>`
> rather than `$`.
### Troubleshooting
WIP: list the most common culprit and provide some basic solutions
### Local Documentation
OrbTK offers the option to install its documentation locally, so you can read it
offline.
Any time a type, a function, a method or a crate is reference by the toolkit
and youre not sure what it does or how to use it, have a look at its application
programming interface (API) documentation to find out!

287
src/ch01-02-hello-orbtk.md Normal file
View File

@@ -0,0 +1,287 @@
## Hello OrbTK!
Now that youve installed the needed building blocks, lets write your first
OrbTK program. Its traditional when learning a new language to write a little
program that outputs the text `Hello, world!`. So well do the same here. We
create a minimal app, that creates a window, position this window at the given
coordinate of your screen. The text will be placed in the center of this
widget.
> Note: This book assumes basic familiarity with the command line. Rust makes
> no specific demands about your editing or tooling or where your code lives, so
> if you prefer to use an integrated development environment (IDE) instead of
> the command line, feel free to use your favorite IDE. Many IDEs now have some
> degree of Rust support; check the IDEs documentation for details. Recently,
> the Rust team has been focusing on enabling great IDE support, and progress
> has been made rapidly on that front!
### Creating a Project Directory
Youll start by making a directory to store your OrbTk code. It doesnt matter
to Rust and OrbTK where your code lives, but for the exercises and projects in
this book, we suggest making a *projects* directory in your home directory and
keeping all your projects there.
Open a terminal and enter the following commands to make a *projects* directory
and a directory for the “Hey OrbTK!” project within the *projects* directory.
For Linux, bsd, macOS, and PowerShell on Windows, enter this:
```console
$ mkdir ~/orbtk
$ cd ~/orbtk
$ mkdir examples
$ cd examples
```
For Windows CMD, enter this:
```cmd
> mkdir "%USERPROFILE%\orbtk"
> cd /d "%USERPROFILE%\orbtk"
> mkdir examples
> cd examples
```
### Writing and Running a OrbTK Application
Next, make a new source file and call it *hello_orbtk.rs*. Rust files always end
with the *.rs* extension. If youre using more than one word to name your source
file, as we have choosen here, it is a good rust habit to separate its words
with an underscore.
Now open the *hello_orbtk.rs* file you just created and enter the code in
Listing 1-1.
<span class="filename">Filename: hello_orbtk.rs</span>
```rust
use orbtk::prelude::*;
fn main() {
// use this only if you want to run it as web application.
orbtk::initialize();
Application::new()
.window(|ctx| {
Window::new()
.title("OrbTk - Hello OrbTK example")
.position((100.0, 100.0))
.size(420.0, 240.0)
.child(
TextBlock::new()
.text("Hey OrbTk!")
.h_align("center")
.v_align("center")
.build(ctx)
)
.build(ctx)
})
.run();
}
```
<span class="caption">Listing 1-1: An OrbTK app that prints `Hey OrbTK!`</span>
In a second step, we need to define the dependencies that are needed to compile our application.
Within the Rust toolchain we will use Cargo. Cargo is a tool that allows Rust packages to
declare their various dependencies and ensure that youll always get a repeatable build.
Go back to your terminal window and change back to your *projects* directory.
```console
$ cd ~/orbtk
```
Create the *Cargo.toml* file in this directory and enter the code in Listing 1-2.
<span class="filename">Filename: Cargo.toml</span>
```cargo
[package]
name = "orbtk-projects"
version = "0.3.1-alpha4"
authors = [
"Florian Blasius <flovanpt@posteo.de>",
"Ralf Zerres <ralf.zerres.de@gmail.com>",
]
description = "The Orbital Widget Toolkit - Training projects"
documentation = "https://docs.rs/orbtk"
repository = "https://github.com/redox-os/orbtk"
readme = "README.md"
license = "MIT"
keywords = [
"orbital",
"widget",
"ui",
]
edition = "2018"
[profile.dev]
opt-level = 1
[dependencies]
#orbtk = { version = "~0.3.1-alpha4" }
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }
```
Save the file and go back to your terminal window. On Linux or macOS, enter
the following commands to compile and run the file:
```console
$ cargo run --release --examples hello_orbtk.rs
```
On Windows, enter the command `.\main.exe` instead of `./main`:
```powershell
> cargo run --release --examples hello_orbtk.rs
```
Regardless of your operating system, a window should be placed on the screen
that prints the string `Hey OrbTK!` in its center. If something is preventing
to successfull position the window, refer back to the [“Troubleshooting”][troubleshooting]
<!-- ignore --> part of the Installation section for ways to get help.
If your can enjoy the rendered output of your `Hey OrbTK!` app,
congratulations! Youve officially written an OrbTK application.
That makes you a OrbTK programmer — welcome!
### Anatomy of an OrbTK Application
Lets review in detail what just happened in your “Hey OrbTK!” application.
Heres the first piece of the puzzle:
```rust
use orbtk::prelude::*;
fn main() {
}
```
The first line is introducing a *use* declaration. A *use* declaration is used
to shorten the path required to refer to rust module items. The *prelude* is a
convinient way to a list of things, that rust will automatically import to you
program. Here, we bind the path *orbtk::prelude*. All default items defined in
this path (referenced with *::*;) are now accessible in your source using their
shorthand name. No need to type in their common prefix (*orbtk::prelude::*)
the third line define a function in Rust. The `main` function is special: it is
always the first code that runs in every executable Rust program. The first
line declares a function named `main` that has no parameters and returns
nothing. If there were parameters, they would go inside the parentheses, `()`.
Also, note that the function body is wrapped in curly brackets, `{}`. Rust
requires these around all function bodies. Its good style to place the opening
curly bracket on the same line as the function declaration, adding one space in
between.
An automatic formatter tool called `rustfmt` will help you to stick to a
standard style across Rust projects. OrbTK is following this guidance.
`rustfmt` will format your code in a particular style. Depending on the version
of your rust toolchain, it is probably already installed on your computer!
Check the online documentation for more details.
Inside the `main` function is the following code:
```rust
orbtk::initialize();
Application::new()
```
There are some important details to notice here.
* First, Rust style is to indent with four spaces, not a tab.
* Second, the method `orbkt::initialize` does all the hard work to initialize
the orbtk environment.
* Third, the method `Application::new` creates a new entity in the entity
comonent system (DECS). DECS an OrbTK dependency that will create and
organize all OrbTK entities. If OrbTK methods change attibutes to the widget
elements, the corresponding DECS object will store this attibutes as
components to the given entity.
Well discuss OrbTK macros and methods in more detail in Chapter <WIP: chapter>.
For now, you just need to know that using a `::new()` means that youre calling
the creation method of a given widget (here: `Application`).
Let's explain the other lines:
```rust
.window(|ctx| {
Window::new()
.title("OrbTk - minimal example")
.position((100.0, 100.0))
.size(420.0, 240.0)
.child(TextBlock::new()
.text("OrbTk")
.h_align("center")
.v_align("center")
.build(ctx)
)
.build(ctx)
})
.run();
```
Inside the `Application` method, we pipe in further instructions. Please notice
the important details:
* First, Rust style is to indent with another four spaces, not a tab.
* Second, The piping is encoded using a `dot` followed by a new method name
(using `window` and `run`).
* Third, the `windows` method takes a Rust closure as its argument.
If you are not familiar with the concept of [closures](https://doc.rust-lang.org/rust-by-example/fn/closures.html), go ahead
and consult the Rust book reference for a deep dive. For now, you just need to
know that a closure can be used as a language shotcut for a function.
When the closure `|ctx| {}` is executed, the result will be
captured inside a return variable (`ctx`). The curly braces define the body,
with the code that is executed inside the closure.
Let's examine this body code of our closure:
* First, We call a method to create a new window entity
(`Windows::new`).
* Second, We define attributes attached to this entity (`title`,
`position`, `size`).
* Third, Inside the defined windows, we create a new child entity
(`child`).
* Fourth, The child method takes arguments. We do create a new textblock
entity (`Textblock::new`). The textblock is extended with the attributes
(`text`, `h_align`, `v_align`).
The text attribute takes the desired string. It's positioning is
controlled with the attriburtion of the horizontal and vertical
alignment. By choosing "center", we do advise the renderer to place
the entity centered within its parent entity, which is the window.
OrbTK is as lazy as possible. We need to call the build method (`build(ctx)`),
that will instatiate the our methods and let the renderer do its work.
With the last statement, we finally call the method that will activate the
Application and drow the Widget on our screen(`run`).
Most lines of Rust code end with a semicolon (`;`), to indicates that this
expression is over and the next one is ready to begin.
### Compiling and Running Are Separate Steps
Before running an OrbTK application, you must compile its source code. A typical
OrbTK project will generate the executable binary code using cargo and place the
result in the target subfolder of the project.
Profiles may be used to configure compiler options such as optimization levels
and debug settings. By default the `dev` or `test` profiles are used. If the
`--release` flag is given, then the release or bench profiles are used.
```console
$ cargo build --release --bin hello_orbtk.rs
$ ../target/release/hello_orbtk
```
On Windows, you need to use `backslash` as a path delimeter:
```powershell
> cargo build --release --bin hello_orbtk.rs
> ..\target\release\hello_orbtk.exe
```
[troubleshooting]: ch01-01-installation.html#troubleshooting

View File

@@ -0,0 +1,3 @@
# OrbTK Example Applications
This is WIP

5
src/ch02-01-widgets.md Normal file
View File

@@ -0,0 +1,5 @@
# OrbTK Example Widgets
This is WIP
Please document the example application widgets.rs

5
src/ch02-02-showcase.md Normal file
View File

@@ -0,0 +1,5 @@
# OrbTK Example Showcase
This is WIP
Please document the example application showcase.rs

25
src/foreword.md Normal file
View File

@@ -0,0 +1,25 @@
# Foreword
This book fully embraces the potential of Rust for develpers creating modern,
fast and extendable user interfaces. Since all component of OrbTK are coded
in Rust itself, it inherits all the benefits of this extraorenary programming
infrastructure. The minimalistic resource consumption, memory safty and a
condensed, well structured modular source code are key factors that makes
OrbTK a promising basis for your future multiplatform GUI projects.
Back in the 80'th runtime environments like Java pioniered the idea of a
"programming once, run everywhere" toolchain. Rust in combination with
OrbTK offers the oppertunity to fullfill this goal while providing
speed, safty and multithreading. You are free to lavarage the capabilities
of modern hardware: Take advantage of multicore CPUs in microcomputers,
singel board computers or the diversity of cloud infrastructures.
Rust let you compile native binary-code and OrbTK will offer the needed
crates, to produce software that matches user demands: running fast,
secure and reliable applications.
Its users will enjoy the friendly and approachable text, that is intended to
help you level up not just your knowledge towards GUI development, but will
also improve your understanding of Rust code.Dive in, get ready to be a
member of the OrbTK and Rust community!
— Ralf Zerres

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1259px" height="847px" viewBox="0 0 1259 847" enable-background="new 0 0 1259 847" xml:space="preserve">
<!--<rect fill="#FFFFFF" width="1259" height="847"/>-->
<path fill="#8F1F1D" d="M706.403,338.05c-131.633,0-251.228,15.825-339.77,41.615v220.298 c88.542,25.79,208.137,41.614,339.77,41.614c150.657,0,285.535-20.729,376.134-53.402V391.457 C991.938,358.781,857.06,338.05,706.403,338.05"/>
<path fill="#8F1F1D" d="M1088.423,537.442c-3.856-10.663-4.629-24.154-1.36-37.162c5.85-23.289,22.421-36.198,37.013-28.833 c3.618,1.827,6.773,4.73,9.387,8.418c0.239-0.001,0.479,0,0.715,0.016c0,0,44.552,53.106,3.313,116.003 c-0.896,3.569-76.534,91.718-94.043,94.524C1031.987,692.244,1058.338,600.41,1088.423,537.442"/>
<path fill="#8F1F1D" d="M357.479,527.021c5.3-9.631,7.158-22.788,4.217-36.426c-5.266-24.416-23.91-41.109-41.642-37.285 c-4.398,0.948-8.325,3.072-11.666,6.099c-0.282-0.059-0.564-0.113-0.845-0.153c0,0-56.292,41.952-12.057,113.924 c0.805,3.741,83.851,108.838,104.311,115.764C413.188,693.475,388.55,596.418,357.479,527.021"/>
<path fill="#E23A26" d="M280.467,535.066l0.007,0.015C280.659,535.226,280.831,535.357,280.467,535.066"/>
<path fill="#E33B26" d="M1174.119,457.903c-0.88-3.064-1.756-6.126-2.662-9.162l30.683-44.451c3.13-4.522,3.771-10.398,1.73-15.555 c-2.04-5.13-6.49-8.81-11.76-9.71l-51.887-8.805c-2.008-4.102-4.115-8.142-6.229-12.15l21.797-49.903 c2.243-5.087,1.769-10.995-1.203-15.608c-2.961-4.636-7.99-7.344-13.349-7.133l-52.656,1.913c-2.727-3.55-5.496-7.068-8.322-10.521 l12.102-53.49c1.225-5.433-0.322-11.118-4.104-15.064c-3.762-3.932-9.229-5.559-14.426-4.283l-51.289,12.608 c-3.321-2.935-6.699-5.833-10.114-8.673l1.849-54.914c0.197-5.559-2.394-10.842-6.845-13.925 c-4.445-3.104-10.093-3.573-14.955-1.266l-47.848,22.747c-3.854-2.21-7.728-4.4-11.644-6.517l-8.455-54.115 c-0.857-5.483-4.386-10.139-9.326-12.266c-4.923-2.137-10.568-1.447-14.891,1.808l-42.659,32.007 c-4.2-1.395-8.419-2.732-12.692-4.011l-18.386-51.316c-1.87-5.229-6.182-9.071-11.438-10.151c-5.238-1.072-10.63,0.742-14.263,4.802 L764.97,100.97c-4.342-0.5-8.685-0.956-13.043-1.331l-27.723-46.713c-2.811-4.732-7.771-7.612-13.116-7.612 c-5.334,0-10.304,2.88-13.09,7.612l-27.733,46.713c-4.358,0.375-8.722,0.831-13.056,1.331l-35.91-40.171 c-3.636-4.06-9.047-5.874-14.268-4.802c-5.255,1.092-9.573,4.922-11.433,10.151l-18.402,51.316 c-4.26,1.279-8.481,2.627-12.691,4.011l-42.644-32.007c-4.336-3.266-9.98-3.955-14.916-1.808c-4.919,2.127-8.461,6.783-9.313,12.266 l-8.461,54.115c-3.914,2.117-7.789,4.294-11.653,6.517l-47.842-22.747c-4.858-2.316-10.529-1.838-14.954,1.266 c-4.445,3.083-7.042,8.366-6.84,13.925l1.835,54.914c-3.405,2.84-6.774,5.738-10.112,8.673l-51.279-12.608 c-5.211-1.265-10.67,0.351-14.441,4.283c-3.795,3.946-5.332,9.631-4.113,15.064l12.079,53.49c-2.802,3.467-5.575,6.971-8.293,10.521 l-52.655-1.913c-5.314-0.157-10.386,2.497-13.356,7.133c-2.974,4.613-3.425,10.521-1.211,15.608l21.814,49.903 c-2.119,4.008-4.224,8.048-6.249,12.15l-51.882,8.805c-5.271,0.888-9.715,4.566-11.765,9.71c-2.037,5.157-1.375,11.033,1.735,15.555 l30.69,44.451c-0.236,0.784-0.455,1.576-0.69,2.364l-16.863,17.911l45.341,64.05c0,0,435.152,200.731,838.797,3.396 C1163.372,528.189,1174.119,457.903,1174.119,457.903"/>
<path d="M788.629,436.277c0,0,54.108-46.602,95.626,11.5c0,0,29.173,74.328-12.593,104.708c0,0-67.353,41.473-95.627-11.5 C776.035,540.985,739.67,497.66,788.629,436.277"/>
<path fill="#FFFFFF" d="M843.648,464.356c-2.452,20.385-16.456,35.467-31.276,33.684c-14.817-1.781-24.846-19.755-22.395-40.14 c2.452-20.385,16.457-35.468,31.274-33.687C836.071,425.997,846.1,443.971,843.648,464.356"/>
<path d="M572.949,399.315c0,0,86.384-26.449,99.021,57.297c0,0,12.086,97.294-79.356,91.705 C592.613,548.317,479.508,512.09,572.949,399.315"/>
<rect x="181" y="45" fill="none" width="1060" height="782"/>
<path fill="#FFFFFF" d="M611.925,441.324c-2.528,21.021-16.969,36.581-32.257,34.742c-15.281-1.837-25.624-20.378-23.095-41.399 c2.529-21.026,16.973-36.581,32.253-34.743C604.113,401.763,614.454,420.298,611.925,441.324"/>
<path fill="#E33B26" d="M292.602,544.216c10.967-12.463,37.611-27.557,35.57-46.282c-3.653-33.526-31.456-57.999-62.099-54.658 c-7.599,0.827-14.658,3.292-20.923,7.035c-0.463-0.106-0.925-0.211-1.388-0.294c0,0-103.632,50.873-44.564,152.657 c0.557,5.137,117.847,155.668,150.787,167.131C371.544,777.307,330.074,641.165,292.602,544.216"/>
<path fill="#E33B26" d="M1134.549,539.673c-12.692-10.7-46.162-20.418-46.92-39.238c-1.355-33.697,22.512-62.021,53.312-63.26 c7.638-0.308,14.983,1.083,21.734,3.857c0.442-0.174,0.884-0.347,1.329-0.497c0,0,110.025,34.951,66.695,144.366 c0.21,5.163-93.468,171.416-124.345,187.635C1086.146,783.151,1111.861,641.105,1134.549,539.673"/>
<rect x="181.06" y="45.314" fill="none" width="1059.75" height="781.686"/>
<path fill="#E33B26" d="M372.142,545.559c0,0-1.383,137.296,133.166,167.933l28.054-56.363c0,0-97.495,9.431-104.995-111.569 H372.142"/>
<rect x="181" y="45" fill="none" width="1060" height="782"/>
<path fill="#E33B26" d="M1057.362,537.246c0,0,1.382,137.296-133.167,167.933l-28.055-56.363c0,0,97.495,9.431,104.995-111.569 H1057.362"/>
<path fill="#E33B26" d="M960.167,677.279c-20.25-48.941-85.595-68.373-145.951-43.399c-53.126,21.98-84.637,71.031-77.624,115.845 c41.946-0.652,86.94-3.371,130.736-9.718c0,0-25.837,41.763-63.857,78.211c25.566,6.599,55.383,4.768,84.076-7.104 C947.904,786.141,980.417,726.221,960.167,677.279"/>
<path fill="#E33B26" d="M585.746,745.985c0,0,55.203,7.295,130.67,9.155c6.61-47.511-29.38-97.792-86.801-117.242 c-63.438-21.488-128.989,2.792-146.414,54.231c-17.425,51.44,19.876,110.561,83.314,132.049 c28.121,9.526,56.653,10.049,81.229,3.207C610.833,790.881,585.746,745.985,585.746,745.985"/>
<rect x="181.06" y="45.314" fill="none" width="1059.75" height="781.686"/>
<g>
<path d="M92.314,318.146l0.072-12.563c-0.359-24.665,8.95-49.384,31.787-73.989c16.267-18.129,29.512-33.493,30.216-49.411 c0.747-16.883-9.835-28.95-33.932-30.499c-15.918-0.704-35.468,4.231-48.394,12.359l-14.075-53.303 c18.296-9.34,47.182-17.729,81.429-16.214c63.672,2.816,91.538,39.33,89.768,79.366c-1.621,36.659-25.84,59.753-45.066,79.202 c-18.24,19.009-26.789,37.48-27.267,59.207l-0.384,8.683L92.314,318.146z M76.808,384.64c1.152-26.048,19.789-43.105,44.872-41.997 c26.047,1.152,42.14,19.746,41.471,45.815c-1.109,25.083-18.824,43.148-45.353,41.975C92.232,429.303,75.698,409.723,76.808,384.64 z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1354px" height="819px" viewBox="0 0 1354 819" enable-background="new 0 0 1354 819" xml:space="preserve">
<!--<rect fill="#FFFFFF" width="1354" height="819"/>-->
<path fill="#8F1F1D" d="M803.403,312.05c-131.633,0-251.228,15.825-339.77,41.615v220.298 c88.542,25.79,208.137,41.614,339.77,41.614c150.657,0,285.535-20.729,376.134-53.402V365.457 C1088.938,332.781,954.06,312.05,803.403,312.05"/>
<path fill="#8F1F1D" d="M1185.423,511.442c-3.856-10.663-4.629-24.154-1.36-37.162c5.85-23.289,22.421-36.198,37.013-28.833 c3.618,1.827,6.773,4.73,9.387,8.418c0.239-0.001,0.479,0,0.715,0.016c0,0,44.552,53.106,3.313,116.003 c-0.896,3.569-76.534,91.718-94.043,94.524C1128.987,666.244,1155.338,574.41,1185.423,511.442"/>
<path fill="#8F1F1D" d="M454.479,501.021c5.3-9.631,7.158-22.788,4.217-36.426c-5.266-24.416-23.91-41.109-41.642-37.285 c-4.398,0.948-8.325,3.072-11.666,6.099c-0.282-0.059-0.564-0.113-0.845-0.153c0,0-56.292,41.952-12.057,113.924 c0.805,3.741,83.851,108.838,104.311,115.764C510.188,667.475,485.55,570.418,454.479,501.021"/>
<path fill="#E23A26" d="M375.467,507.066l0.007,0.015C375.659,507.226,375.831,507.357,375.467,507.066"/>
<path fill="#E33B26" d="M1271.119,431.903c-0.88-3.064-1.756-6.126-2.662-9.162l30.683-44.451c3.13-4.522,3.771-10.398,1.73-15.555 c-2.04-5.13-6.49-8.81-11.76-9.71l-51.887-8.805c-2.008-4.102-4.115-8.142-6.229-12.15l21.797-49.903 c2.243-5.087,1.769-10.995-1.203-15.608c-2.961-4.636-7.99-7.344-13.349-7.133l-52.656,1.913c-2.727-3.55-5.496-7.068-8.322-10.521 l12.102-53.49c1.225-5.433-0.322-11.118-4.104-15.064c-3.762-3.932-9.229-5.559-14.426-4.283l-51.289,12.608 c-3.321-2.935-6.699-5.833-10.114-8.673l1.849-54.914c0.197-5.559-2.394-10.842-6.845-13.925 c-4.445-3.104-10.093-3.573-14.955-1.266l-47.848,22.747c-3.854-2.21-7.728-4.4-11.644-6.517l-8.455-54.115 c-0.857-5.483-4.386-10.139-9.326-12.266c-4.923-2.137-10.568-1.447-14.891,1.808l-42.659,32.007 c-4.2-1.395-8.419-2.732-12.692-4.011l-18.386-51.316c-1.87-5.229-6.182-9.071-11.438-10.151c-5.238-1.072-10.63,0.742-14.263,4.802 L861.97,74.97c-4.342-0.5-8.685-0.956-13.043-1.331l-27.723-46.713c-2.811-4.732-7.771-7.612-13.116-7.612 c-5.334,0-10.304,2.88-13.09,7.612l-27.733,46.713c-4.358,0.375-8.722,0.831-13.056,1.331l-35.91-40.171 c-3.636-4.06-9.047-5.874-14.268-4.802c-5.255,1.092-9.573,4.922-11.433,10.151l-18.402,51.316 c-4.26,1.279-8.481,2.627-12.691,4.011l-42.644-32.007c-4.336-3.266-9.98-3.955-14.916-1.808c-4.919,2.127-8.461,6.783-9.313,12.266 l-8.461,54.115c-3.914,2.117-7.789,4.294-11.653,6.517l-47.842-22.747c-4.858-2.316-10.529-1.838-14.954,1.266 c-4.445,3.083-7.042,8.366-6.84,13.925l1.835,54.914c-3.405,2.84-6.774,5.738-10.112,8.673l-51.279-12.608 c-5.211-1.265-10.67,0.351-14.441,4.283c-3.795,3.946-5.332,9.631-4.113,15.064l12.079,53.49c-2.802,3.467-5.575,6.971-8.293,10.521 l-52.655-1.913c-5.314-0.157-10.386,2.497-13.356,7.133c-2.974,4.613-3.425,10.521-1.211,15.608l21.814,49.903 c-2.119,4.008-4.224,8.048-6.249,12.15l-51.882,8.805c-5.271,0.888-9.715,4.566-11.765,9.71c-2.037,5.157-1.375,11.033,1.735,15.555 l30.69,44.451c-0.236,0.784-0.455,1.576-0.69,2.364l-16.863,17.911l45.341,64.05c0,0,435.152,200.731,838.797,3.396 C1260.372,502.189,1271.119,431.903,1271.119,431.903"/>
<path d="M886.303,395.759c0,0,48.157-52.729,96.315,0c0,0,37.84,70.312,0,105.463c0,0-61.917,49.218-96.315,0 C886.303,501.222,845.024,462.55,886.303,395.759"/>
<path fill="#FFFFFF" d="M942.057,415.32c0,20.532-12.103,37.179-27.029,37.179c-14.924,0-27.027-16.646-27.027-37.179 s12.104-37.18,27.027-37.18C929.954,378.14,942.057,394.788,942.057,415.32"/>
<path d="M671.365,381.361c0,0,82.608-36.576,105.154,45.062c0,0,23.618,95.154-67.837,100.525 C708.682,526.948,592.06,504.486,671.365,381.361"/>
<rect x="278" y="19" fill="none" width="1060" height="782"/>
<g>
<defs>
<rect id="SVGID_1_" x="278.06" y="19.314" width="1059.75" height="781.686"/>
</defs>
<clipPath id="SVGID_2_">
<use xlink:href="#SVGID_1_" overflow="visible"/>
</clipPath>
<path clip-path="url(#SVGID_2_)" fill="#FFFFFF" d="M712.855,416.668c0,21.173-12.48,38.346-27.877,38.346 c-15.391,0-27.874-17.173-27.874-38.346c0-21.178,12.483-38.346,27.874-38.346C700.375,378.322,712.855,395.49,712.855,416.668"/>
<path clip-path="url(#SVGID_2_)" fill="#E33B26" d="M389.602,518.216c10.967-12.463,37.611-27.557,35.57-46.282 c-3.653-33.526-31.456-57.999-62.099-54.658c-7.599,0.827-14.658,3.292-20.923,7.035c-0.463-0.106-0.925-0.211-1.388-0.294 c0,0-103.632,50.873-44.564,152.657c0.557,5.137,117.847,155.668,150.787,167.131C468.544,751.307,427.074,615.165,389.602,518.216 "/>
<path clip-path="url(#SVGID_2_)" fill="#E33B26" d="M1231.549,513.673c-12.692-10.7-46.162-20.418-46.92-39.238 c-1.355-33.697,22.512-62.021,53.312-63.26c7.638-0.308,14.983,1.083,21.734,3.857c0.442-0.174,0.884-0.347,1.329-0.497 c0,0,110.025,34.951,66.695,144.366c0.21,5.163-93.468,171.416-124.345,187.635 C1183.146,757.151,1208.861,615.105,1231.549,513.673"/>
</g>
<rect x="278" y="19" fill="none" width="1060" height="782"/>
<path fill="#E33B26" d="M1154.362,514.558c0,0,1.382,137.296-133.167,167.933l-28.055-56.363c0,0,97.495,9.431,104.995-111.569 H1154.362"/>
<path fill="#E33B26" d="M1057.167,654.591c-20.25-48.941-85.595-68.373-145.951-43.399c-53.126,21.98-84.637,71.031-77.624,115.845 c41.946-0.652,86.94-3.371,130.736-9.718c0,0-25.837,41.763-63.857,78.211c25.566,6.599,55.383,4.768,84.076-7.104 C1044.904,763.452,1077.417,703.532,1057.167,654.591"/>
<g>
<path fill="#E33B26" d="M396.635,512.763c0,0-120.426,65.951-210.88-38.262l36.479-51.313c0,0,37.649,90.426,147.893,39.991 L396.635,512.763"/>
<path fill="#E33B26" d="M144.038,392.655c0,0-46.915-29.995-114.487-63.65C3.436,369.241,14.735,430.034,58.509,471.979 c48.361,46.34,118.025,52.115,155.601,12.901c37.576-39.214,28.833-108.569-19.528-154.908 c-21.437-20.543-47.061-33.103-72.221-37.316C140.333,341.359,144.038,392.655,144.038,392.655"/>
</g>
<rect x="278.06" y="19.314" fill="none" width="1059.75" height="781.686"/>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

30
src/img/ferris/panics.svg Normal file
View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1434.979px" height="947px" viewBox="0 0 1434.979 947" enable-background="new 0 0 1434.979 947" xml:space="preserve">
<!--<rect fill="#FFFFFF" width="1434.979" height="947"/>-->
<path fill="#8F1F1D" d="M712.827,368.579c-131.633,0-251.228,15.825-339.77,41.615v220.298 c88.542,25.79,208.137,41.614,339.77,41.614c150.657,0,285.535-20.729,376.134-53.402V421.986 C998.361,389.311,863.483,368.579,712.827,368.579"/>
<path fill="#8F1F1D" d="M1094.847,567.972c-3.856-10.663-4.629-24.154-1.36-37.162c5.85-23.289,22.421-36.198,37.013-28.833 c3.618,1.827,6.773,4.73,9.387,8.418c0.239-0.001,0.479,0,0.715,0.016c0,0,44.552,53.106,3.313,116.003 c-0.896,3.569-76.534,91.718-94.043,94.524C1038.411,722.773,1064.762,630.939,1094.847,567.972"/>
<path fill="#8F1F1D" d="M363.903,557.551c5.3-9.631,7.158-22.788,4.217-36.426c-5.266-24.416-23.91-41.109-41.642-37.285 c-4.398,0.948-8.325,3.072-11.666,6.099c-0.282-0.059-0.564-0.113-0.845-0.153c0,0-56.292,41.952-12.057,113.924 c0.805,3.741,83.851,108.838,104.311,115.764C419.612,724.004,394.974,626.947,363.903,557.551"/>
<path fill="#E23A26" d="M284.891,563.596l0.007,0.015C285.083,563.755,285.255,563.887,284.891,563.596"/>
<path fill="#E33B26" d="M1180.543,488.433c-0.88-3.064-1.756-6.126-2.662-9.162l30.683-44.451c3.13-4.522,3.771-10.398,1.73-15.555 c-2.04-5.13-6.49-8.81-11.76-9.71l-51.887-8.805c-2.008-4.102-4.115-8.142-6.229-12.15l21.797-49.903 c2.243-5.087,1.769-10.995-1.203-15.608c-2.961-4.636-7.99-7.344-13.349-7.133l-52.656,1.913c-2.727-3.55-5.496-7.068-8.322-10.521 l12.102-53.49c1.225-5.433-0.322-11.118-4.104-15.064c-3.762-3.932-9.229-5.559-14.426-4.283l-51.289,12.608 c-3.321-2.935-6.699-5.833-10.114-8.673l1.849-54.914c0.197-5.559-2.394-10.842-6.845-13.925 c-4.445-3.104-10.093-3.573-14.955-1.266l-47.848,22.747c-3.854-2.21-7.728-4.4-11.644-6.517l-8.455-54.115 c-0.857-5.483-4.386-10.139-9.326-12.266c-4.923-2.137-10.568-1.447-14.891,1.808l-42.659,32.007 c-4.2-1.395-8.419-2.732-12.692-4.011l-18.386-51.316c-1.87-5.229-6.182-9.071-11.438-10.151c-5.238-1.072-10.63,0.742-14.263,4.802 l-35.907,40.171c-4.342-0.5-8.685-0.956-13.043-1.331l-27.723-46.713c-2.811-4.732-7.771-7.612-13.116-7.612 c-5.334,0-10.304,2.88-13.09,7.612l-27.733,46.713c-4.358,0.375-8.722,0.831-13.056,1.331l-35.91-40.171 c-3.636-4.06-9.047-5.874-14.268-4.802c-5.255,1.092-9.573,4.922-11.433,10.151l-18.402,51.316 c-4.26,1.279-8.481,2.627-12.691,4.011l-42.644-32.007c-4.336-3.266-9.98-3.955-14.916-1.808c-4.919,2.127-8.461,6.783-9.313,12.266 l-8.461,54.115c-3.914,2.117-7.789,4.294-11.653,6.517L436.1,168.34c-4.858-2.316-10.529-1.838-14.954,1.266 c-4.445,3.083-7.042,8.366-6.84,13.925l1.835,54.914c-3.405,2.84-6.774,5.738-10.112,8.673L354.75,234.51 c-5.211-1.265-10.67,0.351-14.441,4.283c-3.795,3.946-5.332,9.631-4.113,15.064l12.079,53.49c-2.802,3.467-5.575,6.971-8.293,10.521 l-52.655-1.913c-5.314-0.157-10.386,2.497-13.356,7.133c-2.974,4.613-3.425,10.521-1.211,15.608l21.814,49.903 c-2.119,4.008-4.224,8.048-6.249,12.15l-51.882,8.805c-5.271,0.888-9.715,4.566-11.765,9.71c-2.037,5.157-1.375,11.033,1.735,15.555 l30.69,44.451c-0.236,0.784-0.455,1.576-0.69,2.364l-16.863,17.911l45.341,64.05c0,0,435.152,200.731,838.797,3.396 C1169.796,558.719,1180.543,488.433,1180.543,488.433"/>
<path d="M795.716,446.557c0,0,48.162-52.734,96.324,0c0,0,37.844,70.318,0,105.473c0,0-61.922,49.223-96.324,0 C795.716,552.029,754.434,513.354,795.716,446.557"/>
<path fill="#FFFFFF" d="M855.154,481.097c0,19.782-11.66,35.82-26.041,35.82c-14.379,0-26.04-16.038-26.04-35.82 c0-19.782,11.661-35.821,26.04-35.821C843.494,445.275,855.154,461.315,855.154,481.097"/>
<path d="M578.401,430.129c0,0,84.436-37.385,107.481,46.059c0,0,24.141,97.261-69.339,102.751 C616.543,578.939,497.34,555.98,578.401,430.129"/>
<rect x="187.424" y="75.529" fill="none" width="1060" height="782"/>
<path fill="#FFFFFF" d="M627.514,481.096c0,20.579-12.13,37.27-27.095,37.27c-14.959,0-27.092-16.69-27.092-37.27 c0-20.583,12.133-37.27,27.092-37.27C615.384,443.826,627.514,460.513,627.514,481.096"/>
<path fill="#E33B26" d="M299.026,574.745c10.967-12.463,37.611-27.557,35.57-46.282c-3.653-33.526-31.456-57.999-62.099-54.658 c-7.599,0.827-14.658,3.292-20.923,7.035c-0.463-0.106-0.925-0.211-1.388-0.294c0,0-103.632,50.873-44.564,152.657 c0.557,5.137,117.847,155.668,150.787,167.131C377.968,807.836,336.498,671.694,299.026,574.745"/>
<path fill="#E33B26" d="M1140.973,570.202c-12.692-10.7-46.162-20.418-46.92-39.238c-1.355-33.697,22.512-62.021,53.312-63.26 c7.638-0.308,14.983,1.083,21.734,3.857c0.442-0.174,0.884-0.347,1.329-0.497c0,0,110.025,34.951,66.695,144.366 c0.21,5.163-93.468,171.416-124.345,187.635C1092.57,813.681,1118.285,671.635,1140.973,570.202"/>
<rect x="187.484" y="75.843" fill="none" width="1059.75" height="781.686"/>
<rect x="187.424" y="75.529" fill="none" width="1060" height="782"/>
<g>
<path fill="#E33B26" d="M283.144,565.511c0,0-137.214-4.942-161.62-140.761l57.596-25.427c0,0-13.912,96.957,106.615,110.022 L283.144,565.511"/>
<path fill="#E33B26" d="M127.552,333.083c0,0-24.965-49.774-65.807-113.261C18.721,241.035-2.671,299.05,13.482,357.484 c17.846,64.558,74.749,105.16,127.097,90.69s80.318-78.535,62.471-143.092c-7.909-28.618-23.501-52.519-42.963-69.011 C150.611,287.113,127.552,333.083,127.552,333.083"/>
</g>
<rect x="187.484" y="75.843" fill="none" width="1059.75" height="781.686"/>
<g>
<path fill="#E33B26" d="M1148.012,565.511c0,0,137.214-4.942,161.62-140.761l-57.596-25.428c0,0,13.912,96.957-106.615,110.022 L1148.012,565.511"/>
<path fill="#E33B26" d="M1303.604,333.083c0,0,24.966-49.774,65.808-113.261c43.023,21.212,64.416,79.228,48.262,137.662 c-17.846,64.558-74.748,105.16-127.096,90.689c-52.348-14.47-80.318-78.534-62.472-143.091 c7.909-28.618,23.501-52.519,42.964-69.011C1280.544,287.113,1303.604,333.083,1303.604,333.083"/>
</g>
<path d="M807.895,626.942c-7.131-58.735-72.193-61.431-72.193-61.431c-50.936,11.227-59.183,47.369-57.392,75.104L807.895,626.942z"/>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

70
src/img/ferris/unsafe.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 30 KiB

30
src/title-page.md Normal file
View File

@@ -0,0 +1,30 @@
# The Orbital Widget Toolkit
*by Florian Blasius and Ralf Zerres, with contributions from the Rust Community*
This version of the text assumes youre using OrbTK v0.3.1 or later in
conjuction with Rust 1.41.0 or later with `edition="2018"` in *Cargo.toml*
of all projects to use Rust 2018 Edition idioms.
See the [“Installation” section of Chapter 1][install]<!-- ignore -->
to install or update OrbTK.
The 2020 Edition of this book is the initial release. It will be released with
the OrbTK version 0.3.1.
- Appendix A, “Keywords,” explains the new raw identifiers.
- Appendix D is work in progress and will release instances of this book
once they are translated to other languages.
The HTML format is available
<!---
online at [https://doc.orbtk.org/stable/book/](https://doc.orbtk.org/stable/book/) and
-->
offline with installations of OrbTK made with `cargo docs --book` to open.
<!---
This text is available in [paperback and ebook format from No Starch Press][nsprust].
-->
[install]: ch01-01-installation.html
[nsprust]: https://nostarch.com/orbtk