servicepoint-binding-c/src/commands/global_brightness_command.rs
2025-06-23 23:28:30 +02:00

25 lines
653 B
Rust

use crate::{
commands::wrap_command,
macros::{wrap_fields, wrap_functions},
mem::heap_move_nonnull,
};
use servicepoint::{Brightness, GlobalBrightnessCommand};
use std::ptr::NonNull;
wrap_functions!(associate GlobalBrightnessCommand;
/// Set the brightness of all tiles to the same value.
///
/// Returns: a new [GlobalBrightnessCommand] instance.
fn new(brightness: val Brightness) -> NonNull<GlobalBrightnessCommand> {
heap_move_nonnull(GlobalBrightnessCommand::from(brightness))
}
);
wrap_command!(GlobalBrightness);
wrap_fields!(GlobalBrightnessCommand;
prop brightness: Brightness { get; set; };
);