use par_term_config::{
Config, CursorShaderMetadataCache, ProfileId, ShaderControlParseResult, ShaderMetadataCache,
};
use std::collections::{HashMap, HashSet};
use crate::actions_tab::ActionsTabState;
use crate::advanced_tab::AdvancedTabState;
use crate::ai_inspector_tab::AiInspectorTabState;
use crate::arrangements_tab::ArrangementsTabState;
use crate::automation_tab::AutomationTabState;
use crate::background_tab::BackgroundTabState;
use crate::profile_modal_ui::ProfileModalUI;
use crate::profiles_tab::ProfilesTabState;
use crate::scripts_tab::ScriptsTabState;
use crate::sidebar::SettingsTab;
use crate::snippets_tab::SnippetsTabState;
use crate::{
ArrangementManager, InstallationType, SettingsWindowAction, ShaderDetectModifiedFn,
ShaderInstallResult, ShaderLintFn, ShaderUninstallResult, UpdateCheckResult, UpdateResult,
};
pub struct SettingsUI {
pub visible: bool,
pub config: Config,
pub last_live_opacity: f32,
pub has_changes: bool,
pub temp_font_bold: String,
pub temp_font_italic: String,
pub temp_font_bold_italic: String,
pub temp_font_family: String,
pub temp_font_size: f32,
pub temp_line_spacing: f32,
pub temp_char_spacing: f32,
pub temp_enable_text_shaping: bool,
pub temp_enable_ligatures: bool,
pub temp_enable_kerning: bool,
pub font_pending_changes: bool,
pub temp_custom_shell: String,
pub temp_shell_args: String,
pub temp_working_directory: String,
pub temp_startup_directory: String,
pub temp_initial_text: String,
pub temp_background_image: String,
pub temp_custom_shader: String,
pub temp_cursor_shader: String,
pub temp_shader_channel0: String,
pub temp_shader_channel1: String,
pub temp_shader_channel2: String,
pub temp_shader_channel3: String,
pub temp_cubemap_path: String,
pub temp_background_color: [u8; 3],
pub background_tab: BackgroundTabState,
pub search_query: String,
pub focus_search: bool,
pub shader_editor_visible: bool,
pub shader_editor_source: String,
pub shader_editor_error: Option<String>,
pub shader_editor_original: String,
pub cursor_shader_editor_visible: bool,
pub cursor_shader_editor_source: String,
pub cursor_shader_editor_error: Option<String>,
pub cursor_shader_editor_original: String,
pub available_agent_ids: Vec<(String, String)>,
pub ai_inspector_tab: AiInspectorTabState,
pub available_shaders: Vec<String>,
pub available_cubemaps: Vec<String>,
pub new_shader_name: String,
pub show_create_shader_dialog: bool,
pub show_delete_shader_dialog: bool,
pub shader_search_query: String,
pub shader_search_matches: Vec<usize>,
pub shader_search_current: usize,
pub shader_search_visible: bool,
pub shader_metadata_cache: ShaderMetadataCache,
pub shader_controls_cache: HashMap<String, ShaderControlParseResult>,
pub cursor_shader_metadata_cache: CursorShaderMetadataCache,
pub shader_lint_result: Option<String>,
pub shader_lint_error: Option<String>,
pub shader_settings_expanded: bool,
pub cursor_shader_settings_expanded: bool,
pub current_cols: usize,
pub current_rows: usize,
pub supported_vsync_modes: Vec<par_term_config::VsyncMode>,
pub vsync_warning: Option<String>,
pub keybinding_recording_index: Option<usize>,
pub keybinding_recorded_combo: Option<String>,
pub test_notification_requested: bool,
pub selected_tab: SettingsTab,
pub collapsed_sections: HashSet<String>,
pub shell_integration_action: Option<crate::integrations_tab::ShellIntegrationAction>,
pub profile_modal_ui: ProfileModalUI,
pub profile_save_requested: bool,
pub profile_open_requested: Option<ProfileId>,
pub(crate) shader_installing: bool,
pub(crate) shader_status: Option<String>,
pub(crate) shader_error: Option<String>,
pub(crate) shader_overwrite_prompt_visible: bool,
pub(crate) shader_conflicts: Vec<String>,
shader_install_receiver: Option<std::sync::mpsc::Receiver<Result<ShaderInstallResult, String>>>,
pub automation_tab: AutomationTabState,
pub pending_coprocess_actions: Vec<(usize, bool)>,
pub coprocess_running: Vec<bool>,
pub coprocess_errors: Vec<String>,
pub coprocess_output: Vec<Vec<String>>,
pub coprocess_output_expanded: Vec<bool>,
pub scripts_tab: ScriptsTabState,
pub pending_script_actions: Vec<(usize, bool)>,
pub script_running: Vec<bool>,
pub script_errors: Vec<String>,
pub script_output: Vec<Vec<String>>,
pub script_output_expanded: Vec<bool>,
pub script_panels: Vec<Option<(String, String)>>,
pub open_log_requested: bool,
pub identify_panes_requested: bool,
pub update_install_requested: bool,
pub check_now_requested: bool,
pub update_status: Option<String>,
pub update_result: Option<Result<UpdateResult, String>>,
pub last_update_result: Option<UpdateCheckResult>,
pub update_installing: bool,
update_install_receiver: Option<std::sync::mpsc::Receiver<Result<UpdateResult, String>>>,
pub snippets_tab: SnippetsTabState,
pub actions_tab: ActionsTabState,
pub profiles_tab: ProfilesTabState,
pub advanced_tab: AdvancedTabState,
pub show_reset_defaults_dialog: bool,
pub arrangements_tab: ArrangementsTabState,
pub pending_arrangement_actions: Vec<SettingsWindowAction>,
pub arrangement_manager: ArrangementManager,
pub app_version: &'static str,
pub installation_type: InstallationType,
pub shader_install_fn: Option<fn(bool) -> Result<ShaderInstallResult, String>>,
pub shader_detect_modified_fn: Option<ShaderDetectModifiedFn>,
pub shader_uninstall_fn: Option<fn(bool) -> Result<ShaderUninstallResult, String>>,
pub shader_lint_fn: Option<ShaderLintFn>,
pub shader_has_files_fn: Option<fn(&std::path::Path) -> bool>,
pub shader_count_files_fn: Option<fn(&std::path::Path) -> usize>,
pub shell_integration_is_installed_fn: Option<fn() -> bool>,
pub shell_integration_detected_shell_fn: Option<fn() -> par_term_config::ShellType>,
}
mod async_ops;
mod display;
mod sections;
mod state;