new rendering engine
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use domain::{
|
||||
ContainerNode, Direction, DisplayHint, LayoutChild, LayoutNode, Sizing, Value, WidgetError,
|
||||
WidgetState,
|
||||
AlignItems, ContainerNode, Direction, DisplayHint, DisplayHintKind, JustifyContent,
|
||||
LayoutChild, LayoutNode, Sizing, Value, WidgetError, WidgetState,
|
||||
};
|
||||
use protocol::{
|
||||
WireContainerNode, WireDirection, WireDisplayHint, WireKeyValue, WireLayoutChild,
|
||||
@@ -43,6 +43,8 @@ fn layout_tree_converts_to_wire_and_back() {
|
||||
direction: Direction::Row,
|
||||
gap: 4,
|
||||
padding: 2,
|
||||
justify_content: JustifyContent::Start,
|
||||
align_items: AlignItems::Stretch,
|
||||
children: vec![
|
||||
LayoutChild {
|
||||
sizing: Sizing::Flex(1),
|
||||
@@ -54,6 +56,8 @@ fn layout_tree_converts_to_wire_and_back() {
|
||||
direction: Direction::Column,
|
||||
gap: 2,
|
||||
padding: 0,
|
||||
justify_content: JustifyContent::Start,
|
||||
align_items: AlignItems::Stretch,
|
||||
children: vec![LayoutChild {
|
||||
sizing: Sizing::Flex(1),
|
||||
node: LayoutNode::Leaf(2),
|
||||
@@ -71,9 +75,9 @@ fn layout_tree_converts_to_wire_and_back() {
|
||||
#[test]
|
||||
fn display_hint_converts_to_wire_and_back() {
|
||||
for hint in [
|
||||
DisplayHint::IconValue,
|
||||
DisplayHint::TextBlock,
|
||||
DisplayHint::KeyValue,
|
||||
DisplayHint::new(DisplayHintKind::IconValue),
|
||||
DisplayHint::new(DisplayHintKind::TextBlock),
|
||||
DisplayHint::new(DisplayHintKind::KeyValue),
|
||||
] {
|
||||
let wire: WireDisplayHint = (&hint).into();
|
||||
let roundtripped: DisplayHint = wire.into();
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use protocol::{
|
||||
ClientMessage, ServerMessage, WidgetDescriptor, WireContainerNode, WireDirection,
|
||||
WireDisplayHint, WireKeyValue, WireLayoutChild, WireLayoutNode, WireSizing, WireValue,
|
||||
WireWidgetState, decode_client_message, decode_server_message, encode, encode_client,
|
||||
ClientMessage, ServerMessage, WidgetDescriptor, WireAlignItems, WireContainerNode,
|
||||
WireDirection, WireDisplayHint, WireDisplayHintKind, WireJustifyContent, WireKeyValue,
|
||||
WireLayoutChild, WireLayoutNode, WireSizing, WireValue, WireWidgetState,
|
||||
decode_client_message, decode_server_message, encode, encode_client,
|
||||
};
|
||||
|
||||
#[test]
|
||||
@@ -11,6 +12,8 @@ fn screen_update_round_trips() {
|
||||
direction: WireDirection::Row,
|
||||
gap: 4,
|
||||
padding: 2,
|
||||
justify_content: WireJustifyContent::Start,
|
||||
align_items: WireAlignItems::Stretch,
|
||||
children: vec![
|
||||
WireLayoutChild {
|
||||
sizing: WireSizing::Flex(1),
|
||||
@@ -24,7 +27,7 @@ fn screen_update_round_trips() {
|
||||
}),
|
||||
widgets: vec![WidgetDescriptor {
|
||||
id: 1,
|
||||
display_hint: WireDisplayHint::IconValue,
|
||||
display_hint: WireDisplayHint::new(WireDisplayHintKind::IconValue),
|
||||
state: WireWidgetState {
|
||||
data: vec![
|
||||
WireKeyValue {
|
||||
@@ -52,7 +55,7 @@ fn data_update_round_trips() {
|
||||
let msg = ServerMessage::DataUpdate {
|
||||
widgets: vec![WidgetDescriptor {
|
||||
id: 3,
|
||||
display_hint: WireDisplayHint::TextBlock,
|
||||
display_hint: WireDisplayHint::new(WireDisplayHintKind::TextBlock),
|
||||
state: WireWidgetState {
|
||||
data: vec![WireKeyValue {
|
||||
key: "body".into(),
|
||||
|
||||
Reference in New Issue
Block a user