diff --git a/CHANGELOG.md b/CHANGELOG.md index c991910..981aff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Change Log of Atari Portfolio address file reader ================================================= +Version 0.2.2 / 2024-02-03 +-------------------------- +- switched from tui 0.19.0 (unmaintained) to ratatui 0.26.0 (maintained fork) +- bumped crossterm from 0.25.0 to 0.27.0 + Version 0.2.1 / 2024-02-03 -------------------------- - bumped chrono from 0.4.31 to 0.4.33 diff --git a/Cargo.lock b/Cargo.lock index a03d190..0f503be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,24 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -29,6 +47,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "bstr" version = "0.2.13" @@ -59,6 +83,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" +[[package]] +name = "castaway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.0.83" @@ -103,6 +136,19 @@ dependencies = [ "csv", ] +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if 1.0.0", + "itoa 1.0.10", + "ryu", + "static_assertions", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -111,11 +157,11 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "crossterm" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags", + "bitflags 2.4.2", "crossterm_winapi", "libc", "mio", @@ -142,7 +188,7 @@ checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" dependencies = [ "bstr", "csv-core", - "itoa", + "itoa 0.4.6", "ryu", "serde", ] @@ -156,6 +202,28 @@ dependencies = [ "memchr", ] +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "iana-time-zone" version = "0.1.58" @@ -179,12 +247,33 @@ dependencies = [ "cc", ] +[[package]] +name = "indoc" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + [[package]] name = "js-sys" version = "0.3.66" @@ -225,6 +314,15 @@ dependencies = [ "cfg-if 0.1.10", ] +[[package]] +name = "lru" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" +dependencies = [ + "hashbrown", +] + [[package]] name = "memchr" version = "2.3.3" @@ -281,14 +379,20 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pofo_adr" -version = "0.2.1" +version = "0.2.2" dependencies = [ "chrono", "codepage-437", "crossterm", - "tui", + "ratatui", ] [[package]] @@ -309,13 +413,33 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "ratatui" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "154b85ef15a5d1719bcaa193c3c81fe645cd120c156874cd660fe49fd21d1373" +dependencies = [ + "bitflags 2.4.2", + "cassowary", + "compact_str", + "crossterm", + "indoc", + "itertools", + "lru", + "paste", + "stability", + "strum", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "redox_syscall" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -327,6 +451,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.5" @@ -381,11 +511,49 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +[[package]] +name = "stability" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.43", +] + [[package]] name = "syn" -version = "2.0.43" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -393,16 +561,14 @@ dependencies = [ ] [[package]] -name = "tui" -version = "0.19.0" +name = "syn" +version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccdd26cbd674007e649a272da4475fb666d3aa0ad0531da7136db6fab0e5bad1" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ - "bitflags", - "cassowary", - "crossterm", - "unicode-segmentation", - "unicode-width", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] @@ -413,9 +579,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-segmentation" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" @@ -423,6 +589,12 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -450,7 +622,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.43", "wasm-bindgen-shared", ] @@ -472,7 +644,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -636,3 +808,23 @@ name = "windows_x86_64_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] diff --git a/Cargo.toml b/Cargo.toml index 0f388c2..510deb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pofo_adr" description = "command line reader for the Atari Portfolio address file format." -version = "0.2.1" +version = "0.2.2" authors = ["Simon Rupf "] edition = "2021" license = "GPL-3.0" @@ -15,8 +15,8 @@ rust-version = "1.66" [dependencies] chrono = "0.4.33" codepage-437 = "0.1.0" -crossterm = "=0.25.0" # pin to the version depended on by tui -tui = { version = "0.19.0", default-features = false, features = ['crossterm'] } +crossterm = { version = "=0.27.0", default-features = false, features = ["windows", "events"] } # pin to the version depended on by tui +ratatui = { version = "0.26.0", default-features = false, features = ['crossterm'] } [profile.release] opt-level = 'z' # Optimize for size. diff --git a/README.md b/README.md index 5ecca4b..df0f32d 100644 --- a/README.md +++ b/README.md @@ -48,43 +48,67 @@ lint Run fmt & clippy on the code to come up with improvements. help Displays these usage instructions. $ make release cargo build --release - Compiling libc v0.2.77 - Compiling memchr v2.3.3 + Compiling libc v0.2.151 + Compiling ryu v1.0.5 + Compiling autocfg v1.1.0 + Compiling proc-macro2 v1.0.71 + Compiling cfg-if v1.0.0 Compiling byteorder v1.3.4 - Compiling lazy_static v1.4.0 - Compiling cfg-if v0.1.10 + Compiling memchr v2.3.3 + Compiling unicode-ident v1.0.12 Compiling serde v1.0.116 - Compiling autocfg v1.0.1 - Compiling ryu v1.0.5 + Compiling rustversion v1.0.14 + Compiling quote v1.0.33 Compiling log v0.4.11 - Compiling smallvec v1.4.2 - Compiling scopeguard v1.1.0 + Compiling version_check v0.9.4 + Compiling regex-automata v0.1.9 + Compiling lock_api v0.4.11 + Compiling ahash v0.8.7 + Compiling lazy_static v1.4.0 + Compiling cfg-if v0.1.10 + Compiling parking_lot_core v0.9.9 + Compiling signal-hook v0.3.17 + Compiling csv-core v0.1.10 + Compiling signal-hook-registry v1.4.1 + Compiling once_cell v1.19.0 + Compiling syn v1.0.109 Compiling itoa v0.4.6 - Compiling arc-swap v0.4.7 - Compiling bitflags v1.2.1 - Compiling cassowary v0.3.0 - Compiling unicode-segmentation v1.6.0 - Compiling unicode-width v0.1.8 - Compiling lock_api v0.3.4 + Compiling scopeguard v1.1.0 + Compiling smallvec v1.11.2 + Compiling zerocopy v0.7.32 + Compiling mio v0.8.10 + Compiling syn v2.0.43 Compiling num-traits v0.2.12 - Compiling num-integer v0.1.43 - Compiling csv-core v0.1.10 - Compiling signal-hook-registry v1.2.1 - Compiling parking_lot_core v0.7.2 - Compiling mio v0.7.0 - Compiling time v0.1.44 - Compiling regex-automata v0.1.9 - Compiling parking_lot v0.10.2 - Compiling signal-hook v0.1.16 - Compiling crossterm v0.17.7 - Compiling chrono v0.4.15 - Compiling tui v0.10.0 + Compiling heck v0.4.1 + Compiling allocator-api2 v0.2.16 + Compiling paste v1.0.14 + Compiling hashbrown v0.14.3 + Compiling signal-hook-mio v0.2.3 + Compiling parking_lot v0.12.1 Compiling bstr v0.2.13 + Compiling castaway v0.2.2 + Compiling either v1.9.0 Compiling csv v1.1.3 + Compiling static_assertions v1.1.0 + Compiling itoa v1.0.10 + Compiling bitflags v2.4.2 + Compiling crossterm v0.27.0 Compiling codepage-437 v0.1.0 - Compiling pofo_adr v0.1.0 (/home/elrido/Projekte/pofo_adr) - Finished release [optimized] target(s) in 26.47s -strip target/release/pofo_adr + Compiling compact_str v0.7.1 + Compiling itertools v0.12.1 + Compiling strum_macros v0.26.1 + Compiling lru v0.12.2 + Compiling unicode-width v0.1.8 + Compiling indoc v2.0.4 + Compiling iana-time-zone v0.1.58 + Compiling unicode-segmentation v1.10.1 + Compiling cassowary v0.3.0 + Compiling chrono v0.4.33 + Compiling strum v0.26.1 + Compiling stability v0.1.1 + Compiling ratatui v0.26.0 + Compiling pofo_adr v0.2.2 (Projects/PoFo_adr) + Finished release [optimized] target(s) in 42.98s $ target/release/pofo_adr examples/ez-ref.adr ╔ examples/ez-ref.adr ═══════════════════════════════════════════════════ #122 ╗ ║ ABACUS BOOKS (616)698-0330 ║ diff --git a/src/main.rs b/src/main.rs index 32918bc..add0b09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,8 @@ use crossterm::{ terminal::{disable_raw_mode, enable_raw_mode}, }; -use tui::{ - backend::{Backend, CrosstermBackend}, +use ratatui::{ + backend::CrosstermBackend, layout::Rect, style::{Color, Style}, text::{Span, Text}, @@ -48,7 +48,7 @@ impl<'a> Addresses<'a> { } } - fn draw_block(&mut self, f: &mut Frame) -> Rect { + fn draw_block(&mut self, f: &mut Frame) -> Rect { let size = f.size(); let block = Block::default() .title(format!(" {} ", self.path)) @@ -82,7 +82,7 @@ impl<'a> Addresses<'a> { Rect::new(size.x + 2, size.y + 1, size.width - 3, size.height - 2) } - pub fn draw(&mut self, f: &mut Frame) { + pub fn draw(&mut self, f: &mut Frame) { let inner_size = self.draw_block(f); if self.is_list_mode { let items = List::new(self.headers.clone())