new rendering engine
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::error::TcpServerError;
|
||||
use domain::{BroadcastPort, Layout, WidgetId, WidgetState};
|
||||
use protocol::{ServerMessage, WidgetDescriptor, WireDisplayHint, WireLayoutNode, encode};
|
||||
use domain::{BroadcastPort, DisplayHint, Layout, WidgetId, WidgetState};
|
||||
use protocol::{ServerMessage, WidgetDescriptor, WireLayoutNode, encode};
|
||||
use tokio::sync::broadcast;
|
||||
|
||||
pub struct TcpBroadcaster {
|
||||
@@ -29,14 +29,14 @@ impl BroadcastPort for TcpBroadcaster {
|
||||
async fn push_screen_update(
|
||||
&self,
|
||||
layout: &Layout,
|
||||
widgets: &[(WidgetId, WidgetState)],
|
||||
widgets: &[(WidgetId, DisplayHint, WidgetState)],
|
||||
) -> Result<(), Self::Error> {
|
||||
let wire_layout: WireLayoutNode = (&layout.root).into();
|
||||
let wire_widgets: Vec<WidgetDescriptor> = widgets
|
||||
.iter()
|
||||
.map(|(id, state)| WidgetDescriptor {
|
||||
.map(|(id, hint, state)| WidgetDescriptor {
|
||||
id: *id,
|
||||
display_hint: WireDisplayHint::IconValue,
|
||||
display_hint: hint.into(),
|
||||
state: state.into(),
|
||||
})
|
||||
.collect();
|
||||
@@ -52,13 +52,13 @@ impl BroadcastPort for TcpBroadcaster {
|
||||
|
||||
async fn push_data_update(
|
||||
&self,
|
||||
updates: &[(WidgetId, WidgetState)],
|
||||
updates: &[(WidgetId, DisplayHint, WidgetState)],
|
||||
) -> Result<(), Self::Error> {
|
||||
let wire_widgets: Vec<WidgetDescriptor> = updates
|
||||
.iter()
|
||||
.map(|(id, state)| WidgetDescriptor {
|
||||
.map(|(id, hint, state)| WidgetDescriptor {
|
||||
id: *id,
|
||||
display_hint: WireDisplayHint::IconValue,
|
||||
display_hint: hint.into(),
|
||||
state: state.into(),
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in New Issue
Block a user