This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_editable() { | |
let mut editable = Editable::new(0usize); | |
assert_eq!(editable.done_count(), 0); | |
assert_eq!(editable.undone_count(), 0); | |
editable | |
.edit_snapshot("set 42", |data| { | |
*data = 42; | |
Ok(()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let registry = Registry::default().with_basic_types(); | |
let mut context = Context::new(10240, 10240); | |
let mut lib = FfiLibrary::new("../../target/debug/ffi").unwrap(); | |
let ffi_add = lib | |
.function(function_signature!(®istry => fn add(a: i32, b: i32) -> (result: i32))) | |
.unwrap(); | |
let ffi_ensure = lib | |
.function(function_signature!(®istry => fn ensure_42(v: i32) -> ())) | |
.unwrap(); | |
context.stack().push(2i32); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_neat_xor() { | |
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | |
enum Input { | |
A, | |
B, | |
Control, | |
} | |
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use intuicio_core::prelude::*; | |
use intuicio_data::prelude::*; | |
use intuicio_derive::*; | |
use intuicio_framework_text::{Name, Text}; | |
use std::collections::HashMap; | |
#[derive(IntuicioStruct, Debug, Default)] | |
#[intuicio(module_name = "test")] | |
struct Loc { | |
#[intuicio(ignore)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use hecs::World; | |
use intuicio_core::prelude::*; | |
use intuicio_data::{ | |
lifetime::Lifetime, | |
managed::{ManagedRef, ManagedRefMut}, | |
}; | |
use intuicio_derive::*; | |
#[derive(IntuicioStruct, Default)] | |
struct Health { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(unused_imports)] | |
use raui_app::prelude::*; | |
use raui_immediate::*; | |
mod gui { | |
use raui_immediate::*; | |
use raui_immediate_widgets::prelude::*; | |
pub fn app() { | |
nav_content_box((), || { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure you have seen `immediate_mode` code example first, because this is a continuation of that. | |
use raui_immediate::{make_widgets, ImmediateContext}; | |
use raui_quick_start::RauiQuickStartBuilder; | |
const FONT: &str = "./demos/hello-world/resources/verdana.ttf"; | |
mod gui { | |
use raui_immediate::*; | |
use raui_immediate_widgets::prelude::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of immediate mode UI on top of RAUI. | |
// It's goal is to bring more ergonomics to RAUI by hiding | |
// declarative interface under simple nested function calls. | |
// As with retained mode, immediate mode UI can be mixed with | |
// declarative mode and retained mode widgets. | |
use raui_immediate::{make_widgets, ImmediateContext}; | |
use raui_quick_start::RauiQuickStartBuilder; | |
const FONT: &str = "./demos/hello-world/resources/verdana.ttf"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of retained mode UI on top of RAUI. | |
// It's goals are very similar to Unreal's UMG on top of Slate. | |
// Evolution of this approach allows to use retained mode views | |
// within declarative mode widgets and vice versa - they | |
// interleave quite seamingly. | |
use raui::prelude::*; | |
use raui_quick_start::RauiQuickStartBuilder; | |
use raui_retained::*; | |
use std::any::Any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use raui::prelude::*; | |
use raui_quick_start::RauiQuickStartBuilder; | |
use std::any::Any; | |
#[derive(Default)] | |
struct AppView { | |
pub icons: View<ListView<IconView>>, | |
} | |
impl ViewState for AppView { |
NewerOlder