From 971d6c945513f79d0883f1eee4fdbaa412152a90 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Mon, 1 Jan 2024 13:52:58 -0500 Subject: [PATCH] create constructors for VmcExtSettingWin --- src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 9b23766..04ef480 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1537,7 +1537,7 @@ impl VmcExtSettingColor { } #[derive(Debug)] -struct VmcExtSettingWin { +pub struct VmcExtSettingWin { is_top_most: bool, is_transparent: bool, window_click_through: i32, @@ -1611,6 +1611,18 @@ impl VmcMessage for VmcExtSettingWin { } } +impl VmcExtSettingWin { + pub fn new(is_top_most: bool, is_transparent: bool, window_click_through: i32, hide_border: i32) -> MsgNewResult { + Ok(Self { is_top_most, is_transparent, window_click_through, hide_border}) + } + pub fn new_vmc_message(is_top_most: bool, is_transparent: bool, window_click_through: i32, hide_border: i32) -> TraitMsgNewResult { + match Self::new(is_top_most, is_transparent, window_click_through, hide_border) { + Ok(val) => Ok(Box::new(val)), + Err(val) => Err(val) + } + } +} + #[derive(Debug)] struct VmcExtConfig { path: String,