Sign in to any Nextcloud server (also private ones in a subfolder, with their own port or a self-signed certificate) through the browser with Login Flow v2; the app gets an app password of its own, which "Disconnect" revokes again. A background thread syncs the storage folder with the folder ink-notes on the server every 30 seconds and shortly after saving, three-way against the state after the last pass: one-sided changes are copied, manifests and library.json are merged, a page changed on both sides is kept twice (the server's version as conflict copy, which disk_watch turns into a page), empty pages give way, deletions go into the trash on both sides and lose against changes. Changes to the open notebook wait while it has unsaved changes. Folder ETags spare listing unchanged notebooks; the pass stops instead of deleting when the storage folder or the server folder is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80 lines
1.9 KiB
Rust
80 lines
1.9 KiB
Rust
//! ink-notes: Latenzoptimierte Inking-App für Linux.
|
|
|
|
#[cfg(target_os = "android")]
|
|
pub mod android_bridge;
|
|
pub mod app;
|
|
pub mod assets;
|
|
pub mod autosave;
|
|
pub mod background;
|
|
pub mod canvas;
|
|
pub mod cloud_sync;
|
|
pub mod disk_watch;
|
|
pub mod document;
|
|
pub mod export;
|
|
pub mod file_picker;
|
|
pub mod filter;
|
|
pub mod geometry;
|
|
pub mod history;
|
|
pub mod i18n;
|
|
pub mod image_layer;
|
|
pub mod import;
|
|
pub mod library;
|
|
pub mod math;
|
|
pub mod math_assist;
|
|
pub mod math_ink;
|
|
pub mod nextcloud;
|
|
pub mod osk;
|
|
pub mod page_export;
|
|
pub mod paths;
|
|
pub mod pdf_doc;
|
|
pub mod pdf_merge;
|
|
pub mod pdf_writer;
|
|
pub mod pen;
|
|
pub mod platform;
|
|
pub mod rnote;
|
|
pub mod ruler;
|
|
pub mod saber;
|
|
pub mod selection;
|
|
pub mod settings;
|
|
pub mod spline;
|
|
pub mod storage;
|
|
pub mod text;
|
|
pub mod ui;
|
|
pub mod updater;
|
|
pub mod viewport;
|
|
pub mod xopp;
|
|
|
|
/// Entry point on Android (Issue #42), called by the native activity.
|
|
///
|
|
/// `scripts/package-android.sh` builds the library and packs it into an APK.
|
|
#[cfg(target_os = "android")]
|
|
#[no_mangle]
|
|
fn android_main(app: winit::platform::android::activity::AndroidApp) {
|
|
use winit::platform::android::EventLoopBuilderExtAndroid;
|
|
|
|
android_logger::init_once(
|
|
android_logger::Config::default()
|
|
.with_max_level(log::LevelFilter::Info)
|
|
.with_tag("ink-notes"),
|
|
);
|
|
// Panics would otherwise only go to stderr, which Android discards
|
|
std::panic::set_hook(Box::new(|info| log::error!("{info}")));
|
|
platform::set_android_app(app.clone());
|
|
if let Some(dir) = app.internal_data_path() {
|
|
paths::set_app_dir(dir);
|
|
}
|
|
let event_loop = match winit::event_loop::EventLoopBuilder::new()
|
|
.with_android_app(app)
|
|
.build()
|
|
{
|
|
Ok(event_loop) => event_loop,
|
|
Err(err) => {
|
|
log::error!("event loop: {err}");
|
|
return;
|
|
}
|
|
};
|
|
if let Err(err) = app::run_with(event_loop) {
|
|
log::error!("{err}");
|
|
}
|
|
}
|