#![allow(deprecated)]
use std::convert::TryFrom;
use ncursesw::{ChtypeChar, ChtypeString, ComplexChar, ComplexString, WideString, WINDOW};
use crate::{NCurseswWinError, gen::HasHandle};
pub trait HasInFunctions: HasHandle<WINDOW> {
fn inchnstr(&self, length: u16) -> result!(ChtypeString) {
Ok(ncursesw::winchnstr(self._handle(), i32::try_from(length)?)?)
}
fn inch(&self) -> ChtypeChar {
ncursesw::winch(self._handle())
}
#[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use inchnstr() instead")]
fn inchstr(&self) -> result!(ChtypeString) {
Ok(ncursesw::winchstr(self._handle())?)
}
fn innstr(&self, length: u16) -> result!(String) {
Ok(ncursesw::winnstr(self._handle(), i32::try_from(length)?)?)
}
fn innwstr(&self, length: u16) -> result!(WideString) {
Ok(ncursesw::winnwstr(self._handle(), i32::try_from(length)?)?)
}
#[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use innstr() instead")]
fn instr(&self) -> result!(String) {
Ok(ncursesw::winstr(self._handle())?)
}
fn in_wchnstr(&self, length: u16) -> result!(ComplexString) {
Ok(ncursesw::win_wchnstr(self._handle(), i32::try_from(length)?)?)
}
fn in_wch(&self) -> result!(ComplexChar) {
Ok(ncursesw::win_wch(self._handle())?)
}
#[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use in_wchnstr() instead")]
fn in_wchstr(&self) -> result!(ComplexString) {
Ok(ncursesw::win_wchstr(self._handle())?)
}
#[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use innwstr() instead")]
fn inwstr(&self) -> result!(WideString) {
Ok(ncursesw::winwstr(self._handle())?)
}
}