|
|
|
|
@ -6,31 +6,32 @@ mod imp {
|
|
|
|
|
use super::*; |
|
|
|
|
|
|
|
|
|
#[derive(Debug, Default, glib::Properties)] |
|
|
|
|
#[properties(wrapper_type = super::DummyObject)] |
|
|
|
|
pub struct DummyObject { |
|
|
|
|
#[properties(wrapper_type = super::PlaceholderObject)] |
|
|
|
|
pub struct PlaceholderObject { |
|
|
|
|
/// The identifier of this item.
|
|
|
|
|
#[property(get, set)] |
|
|
|
|
id: RefCell<String>, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[glib::object_subclass] |
|
|
|
|
impl ObjectSubclass for DummyObject { |
|
|
|
|
const NAME: &'static str = "DummyObject"; |
|
|
|
|
type Type = super::DummyObject; |
|
|
|
|
impl ObjectSubclass for PlaceholderObject { |
|
|
|
|
const NAME: &'static str = "PlaceholderObject"; |
|
|
|
|
type Type = super::PlaceholderObject; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[glib::derived_properties] |
|
|
|
|
impl ObjectImpl for DummyObject {} |
|
|
|
|
impl ObjectImpl for PlaceholderObject {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
glib::wrapper! { |
|
|
|
|
/// A dummy GObject.
|
|
|
|
|
/// A GObject to use as a placeholder.
|
|
|
|
|
///
|
|
|
|
|
/// It can be used for example to add extra widgets in a list model and can be identified with its ID.
|
|
|
|
|
pub struct DummyObject(ObjectSubclass<imp::DummyObject>); |
|
|
|
|
/// It can be used for example to add extra widgets in a list model and can
|
|
|
|
|
/// be identified with its ID.
|
|
|
|
|
pub struct PlaceholderObject(ObjectSubclass<imp::PlaceholderObject>); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
impl DummyObject { |
|
|
|
|
impl PlaceholderObject { |
|
|
|
|
pub fn new(id: &str) -> Self { |
|
|
|
|
glib::Object::builder().property("id", id).build() |
|
|
|
|
} |