fractal/utils/
placeholder_object.rs1use gtk::{glib, prelude::*, subclass::prelude::*};
2
3mod imp {
4 use std::cell::RefCell;
5
6 use super::*;
7
8 #[derive(Debug, Default, glib::Properties)]
9 #[properties(wrapper_type = super::PlaceholderObject)]
10 pub struct PlaceholderObject {
11 #[property(get, set)]
13 id: RefCell<String>,
14 }
15
16 #[glib::object_subclass]
17 impl ObjectSubclass for PlaceholderObject {
18 const NAME: &'static str = "PlaceholderObject";
19 type Type = super::PlaceholderObject;
20 }
21
22 #[glib::derived_properties]
23 impl ObjectImpl for PlaceholderObject {}
24}
25
26glib::wrapper! {
27 pub struct PlaceholderObject(ObjectSubclass<imp::PlaceholderObject>);
32}
33
34impl PlaceholderObject {
35 pub fn new(id: &str) -> Self {
36 glib::Object::builder().property("id", id).build()
37 }
38}