From a7b131a11c31ff254afce4b9fd4e016ae9d481eb Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 28 Dec 2020 20:15:26 -0500 Subject: [PATCH] update rust for ncdirect changes --- rust/src/bindings.rs | 12 ++++++------ rust/src/direct/methods.rs | 12 ++++++------ rust/src/direct/reimplemented.rs | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/rust/src/bindings.rs b/rust/src/bindings.rs index 3fca2ebea..75cc4613a 100644 --- a/rust/src/bindings.rs +++ b/rust/src/bindings.rs @@ -134,9 +134,6 @@ pub use ffi::{ #[doc(inline)] pub use ffi::{ // functions - ncdirect_bg_default, - ncdirect_bg_palindex, - ncdirect_bg_rgb, ncdirect_box, ncdirect_canopen_images, ncdirect_canutf8, @@ -154,9 +151,6 @@ pub use ffi::{ ncdirect_dim_x, ncdirect_dim_y, ncdirect_double_box, - ncdirect_fg_default, - ncdirect_fg_palindex, - ncdirect_fg_rgb, ncdirect_flush, ncdirect_getc, ncdirect_hline_interp, @@ -171,6 +165,12 @@ pub use ffi::{ ncdirect_render_frame, ncdirect_render_image, 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_stop, ncdirect_vline_interp, diff --git a/rust/src/direct/methods.rs b/rust/src/direct/methods.rs index e526bf26a..76f2d0877 100644 --- a/rust/src/direct/methods.rs +++ b/rust/src/direct/methods.rs @@ -128,14 +128,14 @@ impl NcDirect { /// /// *C style function: [ncdirect_fg_palindex()][crate::ncdirect_fg_palindex].* 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]. /// /// *C style function: [ncdirect_bg_palindex()][crate::ncdirect_bg_palindex].* 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. @@ -156,14 +156,14 @@ impl NcDirect { /// /// *C style function: [ncdirect_fg_rgb()][crate::ncdirect_fg_rgb].* 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]. /// /// *C style function: [ncdirect_bg_rgb()][crate::ncdirect_bg_rgb].* 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. @@ -206,14 +206,14 @@ impl NcDirect { /// /// *C style function: [ncdirect_fg_default()][crate::ncdirect_fg_default].* 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. /// /// *C style function: [ncdirect_bg_default()][crate::ncdirect_bg_default].* pub fn bg_default(&mut self) -> NcResult<()> { - error![unsafe { crate::ncdirect_bg_default(self) }] + error![unsafe { crate::ncdirect_set_bg_default(self) }] } } diff --git a/rust/src/direct/reimplemented.rs b/rust/src/direct/reimplemented.rs index 3e4f7708e..b47179272 100644 --- a/rust/src/direct/reimplemented.rs +++ b/rust/src/direct/reimplemented.rs @@ -44,7 +44,7 @@ pub fn ncdirect_fg_rgb8( blue: NcColor, ) -> NcIntResult { 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. @@ -58,5 +58,5 @@ pub fn ncdirect_bg_rgb8( blue: NcColor, ) -> NcIntResult { 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) } }