use crate::{ commands::{wrap_command, wrap_origin_accessors}, macros::{wrap_fields, wrap_functions}, }; use servicepoint::{CharGrid, CharGridCommand, Origin}; use std::ptr::NonNull; wrap_command!(CharGrid); wrap_fields!(CharGridCommand; prop grid: CharGrid { get mut; set move; }; ); wrap_origin_accessors!(CharGridCommand); wrap_functions!(associate CharGridCommand; /// Show UTF-8 encoded text on the screen. /// /// The passed [CharGrid] gets consumed. /// /// Returns: a new [CharGridCommand] instance. fn new( grid: move NonNull, origin_x: val usize, origin_y: val usize, ) -> move NonNull { CharGridCommand { grid, origin: Origin::new(origin_x, origin_y), } }; /// Moves the provided [CharGrid] into a new [CharGridCommand], /// leaving other fields as their default values. fn from_grid(grid: move NonNull) -> move NonNull { grid.into() }; );