update rust for ncdirect changes

pull/1270/head
nick black 4 years ago
parent 05b318e487
commit a7b131a11c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -134,9 +134,6 @@ pub use ffi::{
#[doc(inline)] #[doc(inline)]
pub use ffi::{ pub use ffi::{
// functions // functions
ncdirect_bg_default,
ncdirect_bg_palindex,
ncdirect_bg_rgb,
ncdirect_box, ncdirect_box,
ncdirect_canopen_images, ncdirect_canopen_images,
ncdirect_canutf8, ncdirect_canutf8,
@ -154,9 +151,6 @@ pub use ffi::{
ncdirect_dim_x, ncdirect_dim_x,
ncdirect_dim_y, ncdirect_dim_y,
ncdirect_double_box, ncdirect_double_box,
ncdirect_fg_default,
ncdirect_fg_palindex,
ncdirect_fg_rgb,
ncdirect_flush, ncdirect_flush,
ncdirect_getc, ncdirect_getc,
ncdirect_hline_interp, ncdirect_hline_interp,
@ -171,6 +165,12 @@ pub use ffi::{
ncdirect_render_frame, ncdirect_render_frame,
ncdirect_render_image, ncdirect_render_image,
ncdirect_rounded_box, ncdirect_rounded_box,
ncdirect_set_bg_default,
ncdirect_set_bg_palindex,
ncdirect_set_bg_rgb,
ncdirect_set_fg_default,
ncdirect_set_fg_palindex,
ncdirect_set_fg_rgb,
ncdirect_set_styles, ncdirect_set_styles,
ncdirect_stop, ncdirect_stop,
ncdirect_vline_interp, ncdirect_vline_interp,

@ -128,14 +128,14 @@ impl NcDirect {
/// ///
/// *C style function: [ncdirect_fg_palindex()][crate::ncdirect_fg_palindex].* /// *C style function: [ncdirect_fg_palindex()][crate::ncdirect_fg_palindex].*
pub fn fg_palindex(&mut self, index: NcPaletteIndex) -> NcResult<()> { pub fn fg_palindex(&mut self, index: NcPaletteIndex) -> NcResult<()> {
error![unsafe { crate::ncdirect_fg_palindex(self, index as i32) }] error![unsafe { crate::ncdirect_set_fg_palindex(self, index as i32) }]
} }
/// Sets the background [NcPaletteIndex]. /// Sets the background [NcPaletteIndex].
/// ///
/// *C style function: [ncdirect_bg_palindex()][crate::ncdirect_bg_palindex].* /// *C style function: [ncdirect_bg_palindex()][crate::ncdirect_bg_palindex].*
pub fn bg_palindex(&mut self, index: NcPaletteIndex) -> NcResult<()> { pub fn bg_palindex(&mut self, index: NcPaletteIndex) -> NcResult<()> {
error![unsafe { crate::ncdirect_bg_palindex(self, index as i32) }] error![unsafe { crate::ncdirect_set_bg_palindex(self, index as i32) }]
} }
/// Returns the number of simultaneous colors claimed to be supported. /// Returns the number of simultaneous colors claimed to be supported.
@ -156,14 +156,14 @@ impl NcDirect {
/// ///
/// *C style function: [ncdirect_fg_rgb()][crate::ncdirect_fg_rgb].* /// *C style function: [ncdirect_fg_rgb()][crate::ncdirect_fg_rgb].*
pub fn fg_rgb(&mut self, rgb: NcRgb) -> NcResult<()> { pub fn fg_rgb(&mut self, rgb: NcRgb) -> NcResult<()> {
error![unsafe { crate::ncdirect_fg_rgb(self, rgb) }] error![unsafe { crate::ncdirect_set_fg_rgb(self, rgb) }]
} }
/// Sets the background [NcRgb]. /// Sets the background [NcRgb].
/// ///
/// *C style function: [ncdirect_bg_rgb()][crate::ncdirect_bg_rgb].* /// *C style function: [ncdirect_bg_rgb()][crate::ncdirect_bg_rgb].*
pub fn bg_rgb(&mut self, rgb: NcRgb) -> NcResult<()> { pub fn bg_rgb(&mut self, rgb: NcRgb) -> NcResult<()> {
error![unsafe { crate::ncdirect_bg_rgb(self, rgb) }] error![unsafe { crate::ncdirect_set_bg_rgb(self, rgb) }]
} }
/// Sets the foreground [NcColor] components. /// Sets the foreground [NcColor] components.
@ -206,14 +206,14 @@ impl NcDirect {
/// ///
/// *C style function: [ncdirect_fg_default()][crate::ncdirect_fg_default].* /// *C style function: [ncdirect_fg_default()][crate::ncdirect_fg_default].*
pub fn fg_default(&mut self) -> NcResult<()> { pub fn fg_default(&mut self) -> NcResult<()> {
error![unsafe { crate::ncdirect_fg_default(self) }] error![unsafe { crate::ncdirect_set_fg_default(self) }]
} }
/// Indicates to use the "default color" for the background. /// Indicates to use the "default color" for the background.
/// ///
/// *C style function: [ncdirect_bg_default()][crate::ncdirect_bg_default].* /// *C style function: [ncdirect_bg_default()][crate::ncdirect_bg_default].*
pub fn bg_default(&mut self) -> NcResult<()> { pub fn bg_default(&mut self) -> NcResult<()> {
error![unsafe { crate::ncdirect_bg_default(self) }] error![unsafe { crate::ncdirect_set_bg_default(self) }]
} }
} }

@ -44,7 +44,7 @@ pub fn ncdirect_fg_rgb8(
blue: NcColor, blue: NcColor,
) -> NcIntResult { ) -> NcIntResult {
let rgb = (red as NcRgb) << 16 | (green as NcRgb) << 8 | blue as NcRgb; let rgb = (red as NcRgb) << 16 | (green as NcRgb) << 8 | blue as NcRgb;
unsafe { crate::ncdirect_fg_rgb(ncd, rgb) } unsafe { crate::ncdirect_set_fg_rgb(ncd, rgb) }
} }
/// Sets the background [NcColor] components. /// Sets the background [NcColor] components.
@ -58,5 +58,5 @@ pub fn ncdirect_bg_rgb8(
blue: NcColor, blue: NcColor,
) -> NcIntResult { ) -> NcIntResult {
let rgb = (red as NcRgb) << 16 | (green as NcRgb) << 8 | blue as NcRgb; let rgb = (red as NcRgb) << 16 | (green as NcRgb) << 8 | blue as NcRgb;
unsafe { crate::ncdirect_bg_rgb(ncd, rgb) } unsafe { crate::ncdirect_set_bg_rgb(ncd, rgb) }
} }

Loading…
Cancel
Save