From 6d4a62931134c7acd3f68ededaea115933047e55 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Fri, 9 May 2025 19:47:47 +0300 Subject: [PATCH] implement expose stubs for subcommands --- crates/app/src/api.rs | 63 ++++++++++++++++++++++++++++++++++++++++ crates/app/src/config.rs | 8 ++--- deps/tengri | 2 +- 3 files changed, 68 insertions(+), 5 deletions(-) diff --git a/crates/app/src/api.rs b/crates/app/src/api.rs index 8f25f108..21dd4b30 100644 --- a/crates/app/src/api.rs +++ b/crates/app/src/api.rs @@ -18,6 +18,45 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm })); #[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 { 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 { + fn _todo_bool_stub (&self) -> bool { + todo!() + } + fn _todo_path_buf_stub (&self) -> PathBuf { + todo!() + } + fn _todo_arc_str_stub (&self) -> Arc { + 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 { 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 { + fn _todo_opt_clip_stub (&self) -> Option>> { + todo!() + } fn time_lock (&self) -> bool { self.get_time_lock() } diff --git a/crates/app/src/config.rs b/crates/app/src/config.rs index fc996811..10a84445 100644 --- a/crates/app/src/config.rs +++ b/crates/app/src/config.rs @@ -122,8 +122,7 @@ impl Configuration { return Err(format!("(e4) unexpected non-symbol {next:?}").into()) }; - let next = exp.next(); - if let Some(Token { value: Value::Str(path), .. }) = next { + if let Some(Token { value: Value::Str(path), .. }) = exp.peek() { let path = base.as_ref().parent().unwrap().join(unquote(path)); if !std::fs::exists(&path)? { return Err(format!("(e5) not found: {path:?}").into()) @@ -133,8 +132,9 @@ impl Configuration { println!("ok"); let cond = cond.unwrap(); map.add_layer_if( - Box::new(|state|{ - Context::get(state, &Value::Sym(cond)).unwrap_or(false) + Box::new(move |state|{ + let mut exp = exp.clone(); + Context::get(state, &mut exp).unwrap_or(false) }), keys ); diff --git a/deps/tengri b/deps/tengri index 22d63eed..ab07fd2b 160000 --- a/deps/tengri +++ b/deps/tengri @@ -1 +1 @@ -Subproject commit 22d63eed9c9cb5bed5016d851f90773e0f60280d +Subproject commit ab07fd2b4303e1c91325aa3f5bc0014ec5a82961