gloss_renderer/plugin_manager/gui/
checkbox.rs

1use crate::scene::Scene;
2use gloss_hecs::Entity;
3
4use gloss_utils::abi_stable_aliases::std_types::RString;
5#[cfg(not(target_arch = "wasm32"))]
6use gloss_utils::abi_stable_aliases::StableAbi;
7
8#[repr(C)]
9#[cfg_attr(not(target_arch = "wasm32"), derive(StableAbi))]
10pub struct Checkbox {
11    pub name: RString,
12    pub init_val: bool,
13    pub f_clicked: extern "C" fn(bool, RString, Entity, &mut Scene),
14}
15
16impl Checkbox {
17    pub fn new(name: &str, init_val: bool, f_clicked: extern "C" fn(bool, RString, Entity, &mut Scene)) -> Self {
18        Self {
19            name: RString::from(name),
20            init_val,
21            f_clicked,
22        }
23    }
24}