diff --git a/rust/src/plane.rs b/rust/src/plane.rs index e934dee5d..8cb255254 100644 --- a/rust/src/plane.rs +++ b/rust/src/plane.rs @@ -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(), diff --git a/rust/src/types/mod.rs b/rust/src/types/mod.rs index 78f30dea3..af9228cd2 100644 --- a/rust/src/types/mod.rs +++ b/rust/src/types/mod.rs @@ -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, diff --git a/rust/src/types/plane.rs b/rust/src/types/plane.rs index b79e3a2d5..614159940 100644 --- a/rust/src/types/plane.rs +++ b/rust/src/types/plane.rs @@ -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)`