//! Changing what is selected. use gpx_engine::{SelectMode, api}; use tauri::State; use uuid::Uuid; use crate::state::AppState; #[tauri::command(async)] pub fn select(state: State, file_ids: Vec, mode: SelectMode) -> api::Outcome { state.run(move |e| api::select(e, &file_ids, mode)) } #[tauri::command(async)] pub fn select_all(state: State) -> api::Outcome { state.run(api::select_all) } #[tauri::command(async)] pub fn arrow_select(state: State, down: bool, add: bool) -> api::Outcome { state.run(move |e| api::arrow_select(e, down, add)) } #[tauri::command(async)] pub fn select_routes( state: State, file_id: Uuid, route_ids: Vec, mode: SelectMode, ) -> api::Outcome { state.run(move |e| api::select_routes(e, file_id, &route_ids, mode)) } #[tauri::command(async)] pub fn select_tracks( state: State, file_id: Uuid, track_ids: Vec, mode: SelectMode, ) -> api::Outcome { state.run(move |e| api::select_tracks(e, file_id, &track_ids, mode)) } #[tauri::command(async)] pub fn select_segments( state: State, file_id: Uuid, track_id: Uuid, segment_ids: Vec, mode: SelectMode, ) -> api::Outcome { state.run(move |e| api::select_segments(e, file_id, track_id, &segment_ids, mode)) } #[tauri::command(async)] pub fn select_waypoint_group( state: State, file_id: Uuid, mode: SelectMode, ) -> api::Outcome { state.run(move |e| api::select_waypoint_group(e, file_id, mode)) } #[tauri::command(async)] pub fn select_waypoints( state: State, file_id: Uuid, waypoint_ids: Vec, mode: SelectMode, ) -> api::Outcome { state.run(move |e| api::select_waypoints(e, file_id, &waypoint_ids, mode)) }