mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 09:39:03 -04:00
- refactor Notcurses.palette_size() to return an NcResult. - refactor & rename example direct-text.rs to direct-capabilities.rs. - new example full-capabilities.rs
31 lines
683 B
Rust
31 lines
683 B
Rust
use libnotcurses_sys::*;
|
|
|
|
fn main() -> NcResult<()> {
|
|
let mut nc = FullMode::new()?;
|
|
|
|
let (t_rows, t_cols) = nc.term_dim_yx();
|
|
println!("Terminal rows={0}, cols={1}", t_rows, t_cols);
|
|
|
|
println!(
|
|
"Can display UTF-8: {0}
|
|
Can display sextant characters: {1}
|
|
Can open images: {2}
|
|
Can open videos: {3}
|
|
Supports Pixels: {4:?}
|
|
Supports True Color: {5}
|
|
Palette size: {6:?}
|
|
",
|
|
nc.canutf8(),
|
|
nc.cansextant(),
|
|
nc.canopen_images(),
|
|
nc.canopen_videos(),
|
|
nc.check_pixel_support(),
|
|
nc.cantruecolor(),
|
|
nc.palette_size(),
|
|
);
|
|
|
|
println!("Done. Waiting for 10 seconds. . .");
|
|
rsleep![&mut nc, 10];
|
|
Ok(())
|
|
}
|