2021-12-29 17:31:01 -05:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
2021-12-30 16:54:35 -05:00
|
|
|
use glib;
|
2021-12-29 17:31:01 -05:00
|
|
|
|
2021-12-27 17:59:49 -05:00
|
|
|
use crate::DockObject;
|
2021-12-22 12:32:46 -05:00
|
|
|
use crate::Item;
|
|
|
|
|
|
2021-12-20 23:52:59 -05:00
|
|
|
#[derive(Clone, Debug, Default, glib::GBoxed)]
|
2021-12-22 12:32:46 -05:00
|
|
|
#[gboxed(type_name = "BoxedWindowList")]
|
|
|
|
|
pub struct BoxedWindowList(pub Vec<Item>);
|
2021-12-29 17:31:01 -05:00
|
|
|
|
2021-12-27 17:59:49 -05:00
|
|
|
#[derive(Clone, Debug, Default, glib::GBoxed)]
|
|
|
|
|
#[gboxed(type_name = "BoxedDockObject")]
|
|
|
|
|
pub struct BoxedDockObject(pub Option<DockObject>);
|
|
|
|
|
|
|
|
|
|
pub fn data_path() -> PathBuf {
|
|
|
|
|
let mut path = glib::user_data_dir();
|
|
|
|
|
path.push("com.cosmic.dock");
|
|
|
|
|
std::fs::create_dir_all(&path).expect("Could not create directory.");
|
|
|
|
|
path.push("data.json");
|
|
|
|
|
path
|
|
|
|
|
}
|