paperforge-layout 0.1.0

High-level document layout engine
Documentation
use paperforge_core::Rect;

pub struct LayoutEngine {
    #[allow(dead_code)] // exposed via new(); used once layout math lands
    viewport: Rect,
}

impl LayoutEngine {
    pub fn new(viewport: Rect) -> Self {
        Self { viewport }
    }

    pub fn layout(&self) -> LayoutResult {
        LayoutResult::new()
    }
}

impl Default for LayoutEngine {
    fn default() -> Self {
        Self::new(Rect::new(0.0, 0.0, 595.0, 842.0))
    }
}

pub struct LayoutResult {
    pub elements: Vec<LayoutElement>,
}

impl Default for LayoutResult {
    fn default() -> Self {
        Self::new()
    }
}

impl LayoutResult {
    pub fn new() -> Self {
        Self {
            elements: Vec::new(),
        }
    }
}

pub struct LayoutElement {
    pub bounds: Rect,
}