notcurses/rust/examples/full-capabilities.rs
joseLuís 9e2add4e46 [rust] update capabilities, support new functions.
- add new Notcurses methods: `canhalfblock()` and `canquadrant()`.
- add doc links to NCBLIT_* flags from the capabilities methods.
- update the full-capabilites example to include `canhalfblock`, `canquadrant`,
  `canchangecolor` and `canfade` functions.
- rustfmt
2021-04-22 12:25:24 +02:00

43 lines
1013 B
Rust

use libnotcurses_sys::*;
fn main() -> NcResult<()> {
let mut nc = Nc::without_altscreen()?;
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 braille characters: {1}
Can display sextant characters: {2}
Can display quadrant characters: {3}
Can display half block characters: {4}
Can open images: {5}
Can open videos: {6}
Supports Pixels: {7:?}
Supports True Color: {8}
Supports fading: {9}
Supports changing the palette: {10}
Palette size: {11:?}
",
nc.canutf8(),
nc.canbraille(),
nc.cansextant(),
nc.canquadrant(),
nc.canhalfblock(),
nc.canopen_images(),
nc.canopen_videos(),
nc.check_pixel_support(),
nc.cantruecolor(),
nc.canfade(),
nc.canchangecolor(),
nc.palette_size(),
);
let pixelgeom = nc.stdplane().pixelgeom();
println!("{:#?}", pixelgeom);
nc.render()?;
Ok(())
}