//! Pages of paper. use std::fmt::{self, Display, Formatter}; use std::str::FromStr; use super::prelude::*; use super::ColumnsNode; /// Layouts its child onto one or multiple pages. #[derive(Clone, PartialEq, Hash)] pub struct PageNode(pub LayoutNode); #[class] impl PageNode { /// The unflipped width of the page. pub const WIDTH: Smart = Smart::Custom(Paper::A4.width()); /// The unflipped height of the page. pub const HEIGHT: Smart = Smart::Custom(Paper::A4.height()); /// Whether the page is flipped into landscape orientation. pub const FLIPPED: bool = false; /// The left margin. pub const LEFT: Smart = Smart::Auto; /// The right margin. pub const RIGHT: Smart = Smart::Auto; /// The top margin. pub const TOP: Smart = Smart::Auto; /// The bottom margin. pub const BOTTOM: Smart = Smart::Auto; /// The page's background color. pub const FILL: Option = None; /// How many columns the page has. pub const COLUMNS: NonZeroUsize = NonZeroUsize::new(1).unwrap(); /// The page's header. pub const HEADER: Marginal = Marginal::None; /// The page's footer. pub const FOOTER: Marginal = Marginal::None; fn construct(_: &mut Context, args: &mut Args) -> TypResult