2026-07-14 18:36:30 +02:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
|
|
2026-09-18 09:03:51 +02:00
|
|
|
use crate::stack::Stack;
|
2026-07-14 18:36:30 +02:00
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub struct Controller {
|
|
|
|
|
stack: Stack,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
|
impl Controller {
|
|
|
|
|
#[wasm_bindgen(constructor)]
|
|
|
|
|
pub fn new() -> Self {
|
|
|
|
|
Self {
|
|
|
|
|
stack: Stack::default(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-18 09:03:51 +02:00
|
|
|
// #[wasm_bindgen]
|
|
|
|
|
// pub fn create_file(&mut self, name: &str) {
|
|
|
|
|
// let id = self.stack.get_new_file_id();
|
|
|
|
|
// let file = Rc::new(GPXFile::new(id, name));
|
|
|
|
|
// self.stack.update(&[file]);
|
|
|
|
|
// }
|
2026-07-14 18:36:30 +02:00
|
|
|
}
|