You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: windows.rs
    path of file: ./repos/cacao/examples/todos_list
    
    the code of the file until where you have to start completion: //! We use a few different windows in our app lifecycle, so it's easier to
//! just use a small abstraction here and keep the app delegate clean.
//!
//! This could be a lot cleaner, and is something I'd like to make cleaner on a framework level.

use std::sync::RwLock;

use cacao::appkit::window::{Window, WindowConfig, WindowDelegate, WindowStyle, WindowToolbarStyle};
use cacao::notification_center::Dispatcher;

use crate::storage::Message;

use crate::add::AddNewTodoWindow;
use crate::preferences::PreferencesWindow;
use crate::todos::TodosWindow;

#[derive(Default)]
pub struct WindowManager {
    pub main: RwLock<Option<Window<TodosWindow>>>,
    pub preferences: RwLock<
    
    fn on_ui_message(&self, message: Message) {
        match message {
            Message::OpenMainWindow => {
                self.open_main();
            },

            Message::OpenPreferencesWindow => {
                self.open_preferences();
            },

            Message::CloseSheet => {
                self.close_sheet();
            },

            Message::OpenNewTodoSheet => {
                self.open_add();
            },

            Message::StoreNewTodo(_) => {
                self.close_sheet();
            },

            _ => {}
        }

        if let Some(w) = &*(self.main.read().unwrap()) {
            if let Some(delegate) = &w.delegate {
                delegate.on_message(message.clone());
            }
        }

        if let Some(w) = &*(self.preferences.read().unwrap()) {
            if let Some(delegate) = &w.delegate {
                delegate.on_message(message.clone());
            }
        }

        if let Some(w) = &*(self.add.read().unwrap()) {
            if let Some(delegate) = &w.delegate {
                delegate.on_message(message.clone());
            }
        }
    }