rust: clear all mention of ncplane->horiz #1115

This commit is contained in:
nick black 2020-11-17 22:02:41 -05:00 committed by Nick Black
parent bc245e09fc
commit ee019b2d5a
3 changed files with 12 additions and 32 deletions

View File

@ -166,8 +166,8 @@ use crate::{
ncplane_putegc_yx, ncplane_putnstr_yx, ncplane_putstr_yx, ncplane_resize, ncplane_vline_interp,
ncplane_vprintf_yx, notcurses_align,
types::{
AlphaBits, Cell, Channel, Channels, Color, EgcBackstop, IntResult, NcAlign, NcHoriz,
NcPlane, NcPlaneOptionHoriz, NcPlaneOptions, StyleMask, NCPLANE_OPTION_HORALIGNED,
AlphaBits, Cell, Channel, Channels, Color, EgcBackstop, IntResult, NcAlign,
NcPlane, NcPlaneOptions, StyleMask, NCPLANE_OPTION_HORALIGNED,
},
};
@ -175,15 +175,15 @@ use crate::{
impl NcPlaneOptions {
/// `NcPlaneOptions` simple constructor with horizontal x
pub fn new(y: i32, x: i32, rows: u32, cols: u32) -> Self {
Self::with_all_options(y, NcHoriz::x(x), rows, cols, 0)
pub fn new(y: i32, x: u32, rows: u32, cols: u32) -> Self {
Self::with_all_options(y, x, rows, cols, 0)
}
/// `NcPlaneOptions` simple constructor with horizontal alignment
pub fn new_halign(y: i32, align: NcAlign, rows: u32, cols: u32) -> Self {
Self::with_all_options(
y,
NcHoriz::align(align),
align,
rows,
cols,
NCPLANE_OPTION_HORALIGNED,
@ -191,15 +191,10 @@ impl NcPlaneOptions {
}
/// `NcplaneOptions` constructor
pub fn with_all_options(y: i32, horiz: NcHoriz, rows: u32, cols: u32, flags: u64) -> Self {
pub fn with_all_options(y: i32, align: NcAlign, rows: u32, cols: u32, flags: u64) -> Self {
NcPlaneOptions {
y,
horiz: {
match horiz {
NcHoriz::x(data) => NcPlaneOptionHoriz { x: data },
NcHoriz::align(data) => NcPlaneOptionHoriz { align: data },
}
},
align,
rows: rows as i32,
cols: cols as i32,
userptr: null_mut(),

View File

@ -38,10 +38,10 @@ pub use misc::{
};
pub use plane::{
NCBLIT_1x1, NCBLIT_2x1, NCBLIT_2x2, NCBLIT_3x2, NCBLIT_4x1, NCBLIT_8x1, NcAlign, NcBlitter,
NcFdPlane, NcFdPlaneOptions, NcHoriz, NcPlane, NcPlaneOptionHoriz, NcPlaneOptions, NcScale,
NcVisual, NcVisualOptions, NCALIGN_CENTER, NCALIGN_LEFT, NCALIGN_RIGHT, NCALIGN_UNALIGNED,
NCBLIT_BRAILLE, NCBLIT_DEFAULT, NCBLIT_SIXEL, NCPLANE_OPTION_HORALIGNED, NCSCALE_NONE,
NCSCALE_SCALE, NCSCALE_STRETCH, NCVISUAL_OPTION_BLEND, NCVISUAL_OPTION_NODEGRADE,
NcFdPlane, NcFdPlaneOptions, NcPlane, NcPlaneOptions, NcScale, NcVisual, NcVisualOptions,
NCALIGN_CENTER, NCALIGN_LEFT, NCALIGN_RIGHT, NCALIGN_UNALIGNED, NCBLIT_BRAILLE, NCBLIT_DEFAULT,
NCBLIT_SIXEL, NCPLANE_OPTION_HORALIGNED, NCSCALE_NONE, NCSCALE_SCALE, NCSCALE_STRETCH,
NCVISUAL_OPTION_BLEND, NCVISUAL_OPTION_NODEGRADE,
};
pub use terminal::{
NcDirect, NcDirectFlags, NcInput, NcLogLevel, Notcurses, NotcursesOptions,

View File

@ -12,24 +12,9 @@ pub type NcPlane = crate::ncplane;
/// Options struct for [`NcPlane`](type.NcPlane.html)
pub type NcPlaneOptions = crate::ncplane_options;
/// Horizontal alignment relative to the parent plane. Use 'align' instead of 'x'.
/// Horizontal alignment relative to the parent plane. Set alignment in 'x'.
pub const NCPLANE_OPTION_HORALIGNED: u64 = crate::bindings::NCPLANE_OPTION_HORALIGNED as u64;
/// The `horiz` union field of [`NcPlaneOptions`](type.NcPlaneOptions)
///
/// It contains the fields:
///
/// - x: i32
/// - align: NcAlign (u32)
///
pub type NcPlaneOptionHoriz = crate::ncplane_options__bindgen_ty_1;
/// This enum is a wrapper over the C `horiz` union, for the `NcPlaneOption` constructor
pub enum NcHoriz {
x(i32),
align(NcAlign),
}
/// I/O wrapper to dump file descriptor to [`NcPlane`](type.NcPlane.html)
///
/// `type in C: ncfdplane (struct)`