notcurses/rust/examples/full-capabilities.rs
joseLuís bcd09be7d3 [rust] deprecate Notcurses use and rename it to Nc.
In order to be consistent with the rest of the naming scheme, and in order to avoid conflicts with the higher level rust wrappers, which will be using `Notcurses` for the wrapper struct from now on.

- also deprecate `NotcursesOptions` and rename it to `NcOptions`.
- update examples, docs and readme.
2021-06-15 21:00:52 +02:00

44 lines
1.0 KiB
Rust

use libnotcurses_sys::*;
fn main() -> NcResult<()> {
let 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()?;
nc.stop()?;
Ok(())
}