Files
Sylpheed/crates/sylpheed-formats/examples/kf_timeline.rs
MechaCat02 d394ba6aed style: rustfmt sweep — 107 files the lint gate never saw
This branch predates CI on `main`. `cargo fmt --all` only; no behaviour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 16:34:40 +02:00

38 lines
1.1 KiB
Rust

use sylpheed_formats::{pak, ui_layout};
fn main() {
let mut a = std::env::args().skip(1);
let pk = a.next().unwrap();
let bi: usize = a.next().unwrap().parse().unwrap();
let ar = pak::PakArchive::open(pk).unwrap();
let by = ar.read(&ar.entries()[bi]).unwrap();
let b = ui_layout::parse_build(&by).unwrap();
for t in a {
let i: usize = t.parse().unwrap();
let e = &b.elements[i];
println!(
"[{i}] {} kind=0x{:x} parent={:?} pivot=({},{}) kfs={}",
e.name,
e.kind,
e.parent,
e.pivot_x,
e.pivot_y,
e.keyframes.len()
);
for k in &e.keyframes {
println!(
" t={:<5} a={:<4} xy=({},{}) s={}/{} rot={} u4={} u8={} tint={:08x}",
k.time.map(|v| v as i64).unwrap_or(-1),
k.fade >> 24,
k.x,
k.y,
k.scale_x,
k.scale_y,
k.rotation_deg,
k.unknown_4,
k.unknown_8,
k.tint
);
}
}
}