implement expose stubs for subcommands

This commit is contained in:
🪞👃🪞 2025-05-09 19:47:47 +03:00
parent 87cd6099ad
commit 6d4a629311
3 changed files with 68 additions and 5 deletions

View file

@ -18,6 +18,45 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
})); }));
#[tengri_proc::expose] impl App { #[tengri_proc::expose] impl App {
fn _todo_isize_stub (&self) -> isize {
todo!()
}
fn _todo_clip_cmd_stub (&self) -> ClipCommand {
todo!()
}
fn _todo_clock_cmd_stub (&self) -> ClockCommand {
todo!()
}
fn _todo_sampler_cmd_stub (&self) -> SamplerCommand {
todo!()
}
fn _todo_pool_cmd_stub (&self) -> PoolCommand {
todo!()
}
fn _todo_output_cmd_stub (&self) -> OutputCommand {
todo!()
}
fn _todo_input_cmd_stub (&self) -> InputCommand {
todo!()
}
fn _todo_midi_edit_cmd_stub (&self) -> MidiEditCommand {
todo!()
}
fn _todo_message_cmd_stub (&self) -> MessageCommand {
todo!()
}
fn _todo_scene_cmd_stub (&self) -> SceneCommand {
todo!()
}
fn _todo_device_cmd_stub (&self) -> DeviceCommand {
todo!()
}
fn _todo_track_cmd_stub (&self) -> TrackCommand {
todo!()
}
fn _todo_item_theme_stub (&self) -> ItemTheme {
todo!()
}
fn focus_editor (&self) -> bool { fn focus_editor (&self) -> bool {
self.is_editing() self.is_editing()
} }
@ -161,6 +200,27 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
} }
#[tengri_proc::expose] impl MidiPool { #[tengri_proc::expose] impl MidiPool {
fn _todo_bool_stub (&self) -> bool {
todo!()
}
fn _todo_path_buf_stub (&self) -> PathBuf {
todo!()
}
fn _todo_arc_str_stub (&self) -> Arc<str> {
todo!()
}
fn _todo_clip_command_stub (&self) -> PoolClipCommand {
todo!()
}
fn _todo_file_command_stub (&self) -> FileBrowserCommand {
todo!()
}
fn _todo_length_command_stub (&self) -> ClipLengthCommand {
todo!()
}
fn _todo_rename_command_stub (&self) -> ClipRenameCommand {
todo!()
}
fn clip_new (&self) -> MidiClip { fn clip_new (&self) -> MidiClip {
self.new_clip() self.new_clip()
} }
@ -185,6 +245,9 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
} }
#[tengri_proc::expose] impl MidiEditor { #[tengri_proc::expose] impl MidiEditor {
fn _todo_opt_clip_stub (&self) -> Option<Arc<RwLock<MidiClip>>> {
todo!()
}
fn time_lock (&self) -> bool { fn time_lock (&self) -> bool {
self.get_time_lock() self.get_time_lock()
} }

View file

@ -122,8 +122,7 @@ impl Configuration {
return Err(format!("(e4) unexpected non-symbol {next:?}").into()) return Err(format!("(e4) unexpected non-symbol {next:?}").into())
}; };
let next = exp.next(); if let Some(Token { value: Value::Str(path), .. }) = exp.peek() {
if let Some(Token { value: Value::Str(path), .. }) = next {
let path = base.as_ref().parent().unwrap().join(unquote(path)); let path = base.as_ref().parent().unwrap().join(unquote(path));
if !std::fs::exists(&path)? { if !std::fs::exists(&path)? {
return Err(format!("(e5) not found: {path:?}").into()) return Err(format!("(e5) not found: {path:?}").into())
@ -133,8 +132,9 @@ impl Configuration {
println!("ok"); println!("ok");
let cond = cond.unwrap(); let cond = cond.unwrap();
map.add_layer_if( map.add_layer_if(
Box::new(|state|{ Box::new(move |state|{
Context::get(state, &Value::Sym(cond)).unwrap_or(false) let mut exp = exp.clone();
Context::get(state, &mut exp).unwrap_or(false)
}), }),
keys keys
); );

2
deps/tengri vendored

@ -1 +1 @@
Subproject commit 22d63eed9c9cb5bed5016d851f90773e0f60280d Subproject commit ab07fd2b4303e1c91325aa3f5bc0014ec5a82961