use std::collections::HashMap;
use dc_bundle::jni_layout::{self, Layout, LayoutChangedResponse};
pub trait FromTaffyLayout {
fn from_taffy_layout(l: &taffy::prelude::Layout) -> jni_layout::Layout;
}
impl FromTaffyLayout for Layout {
fn from_taffy_layout(l: &taffy::prelude::Layout) -> jni_layout::Layout {
Layout {
order: l.order,
width: l.size.width,
height: l.size.height,
left: l.location.x,
top: l.location.y,
content_width: l.content_size.width,
content_height: l.content_size.height,
..Default::default()
}
}
}
pub trait LayoutChangedResponseUnchangedWithState {
fn unchanged_with_state(layout_state: i32) -> jni_layout::LayoutChangedResponse;
}
impl LayoutChangedResponseUnchangedWithState for LayoutChangedResponse {
fn unchanged_with_state(layout_state: i32) -> jni_layout::LayoutChangedResponse {
LayoutChangedResponse {
layout_state,
changed_layouts: HashMap::new(),
..Default::default()
}
}
}