mod builder;
mod handlers;
mod layout;
mod style;
use crate::element::{AnyElement, IntoElement, Sealed};
use crate::event::{
ElementKeyHandler, ElementTextInputHandler, MouseHandler, PointerHandler, ScrollHandler,
};
use crate::style::Style;
use crate::types::ElementId;
pub struct Div {
pub(super) children: Vec<AnyElement>,
pub(super) layout_style: Style,
pub(super) visual: DivVisual,
pub(super) user_key: Option<String>,
pub(super) last_id: Option<ElementId>,
pub(crate) on_click: Option<MouseHandler>,
pub(crate) on_mouse_down: Option<MouseHandler>,
pub(crate) on_mouse_up: Option<MouseHandler>,
pub(crate) on_mouse_move: Option<MouseHandler>,
pub(crate) on_mouse_scrolled: Option<ScrollHandler>,
pub(crate) on_pointer_event: Option<PointerHandler>,
pub(crate) on_pointer_enter: Option<PointerHandler>,
pub(crate) on_pointer_leave: Option<PointerHandler>,
pub(crate) focusable: bool,
pub(crate) tab_index: i32,
pub(crate) focus_ring: bool,
pub(crate) on_key_down: Option<ElementKeyHandler>,
pub(crate) on_key_up: Option<ElementKeyHandler>,
pub(crate) on_text_input: Option<ElementTextInputHandler>,
pub(crate) ime_capable: bool,
pub(crate) on_ime_preedit: Option<crate::event::ElementImePreeditHandler>,
pub(crate) on_ime_commit: Option<crate::event::ElementImeCommitHandler>,
}
#[derive(Clone, Debug, Default)]
pub struct DivVisual {
pub background: Option<[f32; 4]>,
pub corner_radius: f32,
}
pub struct DivLayoutState {
pub(super) node_id: taffy::NodeId,
}
pub struct DivPaintState;
impl Default for Div {
fn default() -> Self {
Self::new()
}
}
impl Sealed for Div {}
impl IntoElement for Div {
type Element = Self;
fn into_element(self) -> Self {
self
}
}