Trait libbismuth::subclass::prelude::ObjectImpl

pub trait ObjectImpl: ObjectSubclass + ObjectImplExt {
    // Provided methods
    fn properties() -> &'static [ParamSpec] { ... }
    fn signals() -> &'static [Signal] { ... }
    fn set_property(&self, _id: usize, _value: &Value, _pspec: &ParamSpec) { ... }
    fn property(&self, _id: usize, _pspec: &ParamSpec) -> Value { ... }
    fn constructed(&self) { ... }
    fn dispose(&self) { ... }
    fn notify(&self, pspec: &ParamSpec) { ... }
    fn dispatch_properties_changed(&self, pspecs: &[ParamSpec]) { ... }
}
Expand description

Trait for implementors of glib::Object subclasses.

This allows overriding the virtual methods of glib::Object. Except for finalize as implementing Drop would allow the same behavior.

Provided Methods§

fn properties() -> &'static [ParamSpec]

Properties installed for this type.

fn signals() -> &'static [Signal]

Signals installed for this type.

fn set_property(&self, _id: usize, _value: &Value, _pspec: &ParamSpec)

Property setter.

This is called whenever the property of this specific subclass with the given index is set. The new value is passed as glib::Value.

value is guaranteed to be of the correct type for the given property.

fn property(&self, _id: usize, _pspec: &ParamSpec) -> Value

Property getter.

This is called whenever the property value of the specific subclass with the given index should be returned.

The returned Value must be of the correct type for the given property.

fn constructed(&self)

Constructed.

This is called once construction of the instance is finished.

Should chain up to the parent class’ implementation.

fn dispose(&self)

Disposes of the object.

When dispose() ends, the object should not hold any reference to any other member object. The object is also expected to be able to answer client method invocations (with possibly an error code but no memory violation) until it is dropped. dispose() can be executed more than once.

fn notify(&self, pspec: &ParamSpec)

Function to be called when property change is notified for with self.notify("property").

fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])

Object Safety§

This trait is not object safe.

Implementors§