@@ -264,6 +264,11 @@ pub mod ffi {
264264 pub total_chars : i64 ,
265265 }
266266
267+ pub struct FfiWebViewTarget {
268+ pub found : bool ,
269+ pub path : String ,
270+ }
271+
267272 extern "Rust" {
268273 type ConfigManager ;
269274 type DocumentSession ;
@@ -297,7 +302,6 @@ pub mod ffi {
297302 fn config_manager_set_document_opened ( manager : & mut ConfigManager , path : & str , opened : bool ) ;
298303 fn config_manager_get_document_opened ( manager : & ConfigManager , path : & str ) -> bool ;
299304 fn config_manager_remove_document_history ( manager : & mut ConfigManager , path : & str ) ;
300- fn config_manager_remove_navigation_history ( manager : & mut ConfigManager , path : & str ) ;
301305 fn config_manager_get_all_opened_documents ( manager : & ConfigManager ) -> Vec < String > ;
302306 fn config_manager_get_all_documents ( manager : & ConfigManager ) -> Vec < String > ;
303307 fn config_manager_add_bookmark ( manager : & mut ConfigManager , path : & str , start : i64 , end : i64 , note : & str ) ;
@@ -486,8 +490,7 @@ pub mod ffi {
486490 fn session_history_go_forward ( session : & mut DocumentSession , current_pos : i64 ) -> FfiSessionNavResult ;
487491 fn session_activate_link ( session : & mut DocumentSession , position : i64 ) -> FfiLinkActivationResult ;
488492 fn session_get_table_at_position ( session : & DocumentSession , position : i64 ) -> String ;
489- fn session_get_current_section_path ( session : & DocumentSession , position : i64 ) -> String ;
490- fn session_extract_resource ( session : & DocumentSession , resource_path : & str , output_path : & str ) -> Result < bool > ;
493+ fn session_webview_target ( session : & DocumentSession , position : i64 , temp_dir : & str ) -> FfiWebViewTarget ;
491494 fn session_get_status_info ( session : & DocumentSession , position : i64 ) -> FfiStatusInfo ;
492495 fn session_stats ( session : & DocumentSession ) -> FfiDocumentStats ;
493496 fn session_page_count ( session : & DocumentSession ) -> usize ;
@@ -593,7 +596,6 @@ ffi_wrapper!(config_manager_get_document_position, get_document_position(path: &
593596ffi_wrapper ! ( mut config_manager_set_document_opened, set_document_opened( path: & str , opened: bool ) ) ;
594597ffi_wrapper ! ( config_manager_get_document_opened, get_document_opened( path: & str ) -> bool ) ;
595598ffi_wrapper ! ( mut config_manager_remove_document_history, remove_document_history( path: & str ) ) ;
596- ffi_wrapper ! ( mut config_manager_remove_navigation_history, remove_navigation_history( path: & str ) ) ;
597599ffi_wrapper ! ( config_manager_get_all_opened_documents, get_all_opened_documents -> Vec <String >) ;
598600ffi_wrapper ! ( config_manager_get_all_documents, get_all_documents -> Vec <String >) ;
599601
@@ -1091,12 +1093,9 @@ fn session_get_table_at_position(session: &DocumentSession, position: i64) -> St
10911093 session. get_table_at_position ( position) . unwrap_or_default ( )
10921094}
10931095
1094- fn session_get_current_section_path ( session : & DocumentSession , position : i64 ) -> String {
1095- session. get_current_section_path ( position) . unwrap_or_default ( )
1096- }
1097-
1098- fn session_extract_resource ( session : & DocumentSession , resource_path : & str , output_path : & str ) -> Result < bool , String > {
1099- session. extract_resource ( resource_path, output_path) . map_err ( |e| e. to_string ( ) )
1096+ fn session_webview_target ( session : & DocumentSession , position : i64 , temp_dir : & str ) -> ffi:: FfiWebViewTarget {
1097+ let path = session. webview_target_path ( position, temp_dir) ;
1098+ ffi:: FfiWebViewTarget { found : path. is_some ( ) , path : path. unwrap_or_default ( ) }
11001099}
11011100
11021101fn session_get_status_info ( session : & DocumentSession , position : i64 ) -> ffi:: FfiStatusInfo {
0 commit comments