[rust] remove NcDirectV type alias, use NcPlane instead

pull/1809/head
joseLuís 3 years ago
parent ce6dab70cc
commit 3fed537854

@ -5,8 +5,8 @@ use core::ptr::{null, null_mut};
use crate::ffi::sigset_t; use crate::ffi::sigset_t;
use crate::{ use crate::{
cstring, error, error_ref_mut, rstring, NcAlign, NcBlitter, NcCapabilities, NcChannels, cstring, error, error_ref_mut, rstring, NcAlign, NcBlitter, NcCapabilities, NcChannels,
NcComponent, NcDim, NcDirect, NcDirectFlags, NcDirectV, NcEgc, NcError, NcInput, NcOffset, NcComponent, NcDim, NcDirect, NcDirectFlags, NcEgc, NcError, NcInput, NcOffset, NcPaletteIndex,
NcPaletteIndex, NcResult, NcRgb, NcScale, NcStyle, NcTime, NCRESULT_ERR, NcPlane, NcResult, NcRgb, NcScale, NcStyle, NcTime, NCRESULT_ERR,
}; };
/// # `NcDirect` constructors and destructors /// # `NcDirect` constructors and destructors
@ -68,7 +68,7 @@ impl NcDirect {
/// and writes it to the output. /// and writes it to the output.
/// ///
/// *C style function: [ncdirect_raster_frame()][crate::ncdirect_raster_frame].* /// *C style function: [ncdirect_raster_frame()][crate::ncdirect_raster_frame].*
pub fn raster_frame(&mut self, frame: &mut NcDirectV, align: NcAlign) -> NcResult<()> { pub fn raster_frame(&mut self, frame: &mut NcPlane, align: NcAlign) -> NcResult<()> {
error![ error![
unsafe { crate::ncdirect_raster_frame(self, frame, align) }, unsafe { crate::ncdirect_raster_frame(self, frame, align) },
"NcDirect.raster_frame()" "NcDirect.raster_frame()"
@ -94,7 +94,7 @@ impl NcDirect {
scale: NcScale, scale: NcScale,
max_y: NcDim, max_y: NcDim,
max_x: NcDim, max_x: NcDim,
) -> NcResult<&'a mut NcDirectV> { ) -> NcResult<&'a mut NcPlane> {
let res = unsafe { let res = unsafe {
crate::ncdirect_render_frame( crate::ncdirect_render_frame(
self, self,
@ -664,7 +664,7 @@ impl NcDirect {
/// Draws a box with its upper-left corner at the current cursor position, /// Draws a box with its upper-left corner at the current cursor position,
/// having dimensions `ylen` * `xlen`. /// having dimensions `ylen` * `xlen`.
/// ///
/// See NcPlane.[box()][crate::NcPlane#method.box] for more information. /// See NcPlane.[box()][NcPlane#method.box] for more information.
/// ///
/// The minimum box size is 2x2, and it cannot be drawn off-screen. /// The minimum box size is 2x2, and it cannot be drawn off-screen.
/// ///

@ -271,9 +271,6 @@ pub use reimplemented::*;
/// ///
pub type NcPlane = crate::bindings::ffi::ncplane; pub type NcPlane = crate::bindings::ffi::ncplane;
/// A type alias of [`NcPlane`] to be used in [`NcDirect`][crate::NcDirect] mode.
pub type NcDirectV = NcPlane;
/// Options struct for [`NcPlane`] /// Options struct for [`NcPlane`]
pub type NcPlaneOptions = crate::bindings::ffi::ncplane_options; pub type NcPlaneOptions = crate::bindings::ffi::ncplane_options;

@ -5,8 +5,8 @@ use libc::c_void;
use crate::{ use crate::{
cstring, error, error_ref_mut, rstring, Nc, NcBlitter, NcComponent, NcDim, NcDirect, NcDirectF, cstring, error, error_ref_mut, rstring, Nc, NcBlitter, NcComponent, NcDim, NcDirect, NcDirectF,
NcDirectV, NcError, NcIntResult, NcPixel, NcPlane, NcResult, NcRgba, NcScale, NcTime, NcVGeom, NcError, NcIntResult, NcPixel, NcPlane, NcResult, NcRgba, NcScale, NcTime, NcVGeom, NcVisual,
NcVisual, NcVisualOptions, NCBLIT_PIXEL, NCRESULT_ERR, NcVisualOptions, NCBLIT_PIXEL, NCRESULT_ERR,
}; };
/// # NcVisualOptions Constructors /// # NcVisualOptions Constructors
@ -574,7 +574,7 @@ impl NcDirectF {
&mut self, &mut self,
ncd: &mut NcDirect, ncd: &mut NcDirect,
options: &NcVisualOptions, options: &NcVisualOptions,
) -> NcResult<&mut NcDirectV> { ) -> NcResult<&mut NcPlane> {
error_ref_mut![ error_ref_mut![
unsafe { crate::ncdirectf_render(ncd, self, options) }, unsafe { crate::ncdirectf_render(ncd, self, options) },
"NcVisual.render()" "NcVisual.render()"

Loading…
Cancel
Save