Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
GSK_RENDERER=cairo \
xvfb-run -a cargo test -p onenote-render-gtk \
scroll_adjustments_invalidate_the_viewport_snapshot --locked --offline
GTK_A11Y=none \
GSK_RENDERER=cairo \
xvfb-run -a cargo test -p onenote-render-gtk \
attachment_ --locked --offline
GTK_A11Y=none \
GSK_RENDERER=cairo \
xvfb-run -a cargo test -p onenote-viewer --locked --offline
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ onenote-render = { path = "crates/onenote-render" }
onenote-render-gtk = { path = "crates/onenote-render-gtk" }
onenote_parser = { git = "https://github.com/msiemens/onenote.rs", tag = "v2.0.0" }
rusqlite = { version = "0.32.1", features = ["bundled"] }
sanitize-filename = "0.6.0"
serde = { version = "1.0.219", features = ["derive", "rc"] }
serde_json = "1.0.140"
tempfile = "3.19.1"
Expand Down
32 changes: 31 additions & 1 deletion crates/onenote-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub enum Error {
status: crate::ResourceStatus,
},

/// A resource exceeded the caller's explicit memory limit.
/// A resource exceeded the caller's explicit size limit.
#[error("resource {id} is {declared_bytes} bytes, above the {limit_bytes}-byte limit")]
ResourceTooLarge {
/// Stable resource identifier.
Expand All @@ -66,6 +66,36 @@ pub enum Error {
source: std::io::Error,
},

/// Writing a lazily loaded resource failed.
#[error("could not write resource {id}: {source}")]
ResourceWrite {
/// Stable resource identifier.
id: crate::ResourceId,
/// Underlying output failure.
#[source]
source: std::io::Error,
},

/// Copying a lazy resource was cancelled by its caller.
#[error("copying resource {id} was cancelled")]
ResourceCopyCancelled {
/// Stable resource identifier.
id: crate::ResourceId,
},

/// The resource payload length disagreed with its declared length.
#[error(
"resource {id} contains {actual_bytes} bytes, but its source declares {declared_bytes} bytes"
)]
ResourceSizeMismatch {
/// Stable resource identifier.
id: crate::ResourceId,
/// Size recorded in the `OneNote` source.
declared_bytes: u64,
/// Number of bytes returned by the lazy reader.
actual_bytes: u64,
},

/// No supported external CAB extractor is available.
#[error("could not find 7zz or 7z in PATH; install 7-Zip to open .onepkg files")]
ExtractorNotFound,
Expand Down
7 changes: 5 additions & 2 deletions crates/onenote-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ pub use model::{
};
pub use package::{ExtractionPhase, ExtractionReport, OnePkgExtractor};
pub use parser::{LoadOptions, LoadedNotebook, OneNoteLoader, ParseLimits};
pub use resource::ResourceStore;
pub use resource::{
ResourceCopyControl, ResourceCopyOptions, ResourceCopyProgress, ResourceCopyReport,
ResourceStore,
};

/// The crate API version during the pre-1.0 implementation phase.
pub const API_VERSION: u32 = 5;
pub const API_VERSION: u32 = 6;

/// Logical display pixels per `OneNote` half-inch layout unit at 96 DPI.
pub const PIXELS_PER_HALF_INCH: f32 = 48.0;
Loading
Loading