use crate::primitives::TemplatedControlImpl;
use crate::{ControlImpl, IconElement};
use ferroui_base::input::InputElementImpl;
use ferroui_base::interactivity::InteractiveImpl;
use ferroui_base::layout::LayoutableImpl;
use ferroui_base::media::Geometry;
use ferroui_base::{
ferro_class, ferro_impl_classes, ferro_property, instantiate, FerroObjectImpl, FerroProperty,
Nullable, Ref, StyledElementImpl, StyledProperty, Visual, VisualImpl,
};
#[repr(C)]
pub struct PathIcon {
base: IconElement,
}
ferro_class!(PathIcon: IconElement);
ferroui_base::ferro_class_info!(PathIcon { new: PathIcon::new });
ferro_impl_classes!(
PathIcon: StyledElementImpl,
VisualImpl,
LayoutableImpl,
InteractiveImpl,
InputElementImpl,
ControlImpl,
TemplatedControlImpl
);
ferroui_base::ferro_impl_classes!(PathIcon: FerroObjectImpl);
ferroui_base::ferro_properties! { impl PathIcon {
ferro_property!(
pub fn data_property() -> StyledProperty<Option<Ref<Geometry>>> {
FerroProperty::register::<PathIcon, _>("Data", None)
}
);
} }
impl PathIcon {
fn static_constructor() {
Visual::affects_render::<PathIcon>(&[Self::data_property().as_property()]);
}
pub fn construct() -> Self {
Self { base: IconElement::construct() }
}
pub fn new() -> Ref<Self> {
instantiate(Self::construct())
}
pub fn data(&self) -> Option<Ref<Geometry>> {
self.get_value(Self::data_property())
}
pub fn set_data(&self, value: impl Into<Nullable<Geometry>>) {
self.set_value(Self::data_property(), value.into().0)
}
}