mod imp;
mod layers;
use crate::render::Render;
use femtovg::{renderer::OpenGl, Canvas};
pub use layers::{Layer, LayerImpl, Target};
use std::cell::Ref;

use crate::render::imp::{RenderConfig, RenderStatus};

glib::wrapper! {
    pub struct InteriorWidget(ObjectSubclass<imp::InteriorWidget>);
}

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

impl InteriorWidget {
    pub fn new() -> Self {
        let this: Self = glib::Object::new();
        this
    }

    pub fn draw(
        &self,
        layers: &Vec<Layer>,
        render: &Render,
        status: Ref<'_, RenderStatus>,
        _c: Ref<'_, RenderConfig>,
    ) {
        for layer in layers.iter().filter(|x| x.visiable) {
            layer.draw(render, (1000.0, 1000.0));
        }
    }
}
