refactor: begin restructuring core code to better encapsulate

This is a first pass towards trying to structure things a bit better, with data generally encapsulated under a single hierarchical tree, rather than lots of globals all over the place. Lots of work is still required.

The plan is that with this and some more work, #291 should become a lot easier to sort.
This commit is contained in:
Jake Stanger
2023-12-08 22:39:27 +00:00
parent 08e354e019
commit b2fa19ab6c
14 changed files with 490 additions and 415 deletions

View File

@@ -1,7 +1,7 @@
#[cfg(feature = "ipc")]
use crate::ironvar::get_variable_manager;
use crate::script::Script;
use crate::send;
#[cfg(feature = "ipc")]
use crate::Ironbar;
use cfg_if::cfg_if;
use glib::Continue;
use serde::Deserialize;
@@ -55,7 +55,7 @@ impl DynamicBool {
}
#[cfg(feature = "ipc")]
DynamicBool::Variable(variable) => {
let variable_manager = get_variable_manager();
let variable_manager = Ironbar::variable_manager();
let variable_name = variable[1..].into(); // remove hash
let mut rx = crate::write_lock!(variable_manager).subscribe(variable_name);