mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +00:00
Use ".60" design markup consistently
It's a mark up language that targets the design, not say the business logic.
This commit is contained in:
parent
c6b7e04652
commit
0e10008c47
2 changed files with 10 additions and 10 deletions
|
@ -18,7 +18,7 @@ Included in this documentation is also the [language reference](langref/index.ht
|
||||||
|
|
||||||
## How to use:
|
## How to use:
|
||||||
|
|
||||||
The user interfaces are described in the `.60` markup language. There are two ways
|
The user interfaces are described in the `.60` design markup language. There are two ways
|
||||||
of including the design in Rust:
|
of including the design in Rust:
|
||||||
|
|
||||||
- The `.60` code is inline in a macro.
|
- The `.60` code is inline in a macro.
|
||||||
|
@ -31,7 +31,7 @@ of including the design in Rust:
|
||||||
|
|
||||||
### The .60 code in a macro
|
### The .60 code in a macro
|
||||||
|
|
||||||
This method combines your Rust code with the `.60` markup in one file, using a macro:
|
This method combines your Rust code with the `.60` design markup in one file, using a macro:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
sixtyfps::sixtyfps!{
|
sixtyfps::sixtyfps!{
|
||||||
|
@ -89,7 +89,7 @@ fn main() {
|
||||||
|
|
||||||
### Types
|
### Types
|
||||||
|
|
||||||
The types used for properties in `.60` markup each translate to specific types in Rust.
|
The types used for properties in `.60` design markup each translate to specific types in Rust.
|
||||||
The follow table summarizes the entire mapping:
|
The follow table summarizes the entire mapping:
|
||||||
|
|
||||||
| `.60` Type | Rust Type | Note |
|
| `.60` Type | Rust Type | Note |
|
||||||
|
@ -199,13 +199,13 @@ pub mod langref {
|
||||||
#![doc = ""]
|
#![doc = ""]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This module exists only to explain the API of the code generated from `.60` markup. Its described structure
|
/// This module exists only to explain the API of the code generated from `.60` design markup. Its described structure
|
||||||
/// is not really contained in the compiled crate.
|
/// is not really contained in the compiled crate.
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
pub mod generated_code {
|
pub mod generated_code {
|
||||||
/// This an example of the API that is generated for a component in `.60` markup. This may help you understand
|
/// This an example of the API that is generated for a component in `.60` design markup. This may help you understand
|
||||||
/// what functions you can call and how you can pass data in and out.
|
/// what functions you can call and how you can pass data in and out.
|
||||||
/// This is the `.60` markup source code:
|
/// This is the source code:
|
||||||
/// ```sixtyfps
|
/// ```sixtyfps
|
||||||
/// export SampleComponent := Window {
|
/// export SampleComponent := Window {
|
||||||
/// property<int> counter;
|
/// property<int> counter;
|
||||||
|
@ -237,19 +237,19 @@ pub mod generated_code {
|
||||||
) -> super::re_exports::PinWeak<Self> {
|
) -> super::re_exports::PinWeak<Self> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
/// Returns the value of the counter property declared in the `.60` markup.
|
/// Returns the value of the counter property declared in the `.60` design markup.
|
||||||
pub fn get_counter(self: ::core::pin::Pin<&Self>) -> i32 {
|
pub fn get_counter(self: ::core::pin::Pin<&Self>) -> i32 {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
/// Assigns a new value to the counter property.
|
/// Assigns a new value to the counter property.
|
||||||
pub fn set_counter(&self, value: i32) {}
|
pub fn set_counter(&self, value: i32) {}
|
||||||
/// Returns the value of the user_name property declared in the `.60` markup.
|
/// Returns the value of the user_name property declared in the `.60` design markup.
|
||||||
pub fn get_user_name(self: ::core::pin::Pin<&Self>) -> super::re_exports::SharedString {
|
pub fn get_user_name(self: ::core::pin::Pin<&Self>) -> super::re_exports::SharedString {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
/// Assigns a new value to the user_name property.
|
/// Assigns a new value to the user_name property.
|
||||||
pub fn set_user_name(&self, value: super::re_exports::SharedString) {}
|
pub fn set_user_name(&self, value: super::re_exports::SharedString) {}
|
||||||
/// Emits the hello signal declared in the `.60` markup.
|
/// Emits the hello signal declared in the `.60` design markup.
|
||||||
pub fn emit_hello(self: ::core::pin::Pin<&Self>) {}
|
pub fn emit_hello(self: ::core::pin::Pin<&Self>) {}
|
||||||
/// Registers the function f as callback when the signal hello is emitted. In order to access
|
/// Registers the function f as callback when the signal hello is emitted. In order to access
|
||||||
/// the component in the callback, you'd typically capture a weak reference obtained using
|
/// the component in the callback, you'd typically capture a weak reference obtained using
|
||||||
|
|
|
@ -208,7 +208,7 @@ fn extract_include_paths(
|
||||||
(remaining_stream, include_paths)
|
(remaining_stream, include_paths)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This macro allows you to use the `.60` markup language inline in Rust code. Within the braces of the macro
|
/// This macro allows you to use the `.60` design markup language inline in Rust code. Within the braces of the macro
|
||||||
/// you can use place `.60` code and the named exported components will be available for instantiation.
|
/// you can use place `.60` code and the named exported components will be available for instantiation.
|
||||||
#[proc_macro]
|
#[proc_macro]
|
||||||
pub fn sixtyfps(stream: TokenStream) -> TokenStream {
|
pub fn sixtyfps(stream: TokenStream) -> TokenStream {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue