gtk4/
object_expression.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::ObjectExpression;
6
7define_expression!(ObjectExpression, crate::ffi::GtkObjectExpression);
8
9impl std::fmt::Debug for ObjectExpression {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        f.debug_struct("ObjectExpression")
12            .field("value_type", &self.value_type())
13            .field("is_static", &self.is_static())
14            .field("object", &self.object())
15            .finish()
16    }
17}
18
19#[cfg(test)]
20mod tests {
21    use super::*;
22    use crate as gtk4;
23
24    #[test]
25    fn test_object_expression() {
26        let obj = crate::IconTheme::new();
27        let expr = ObjectExpression::new(&obj);
28        assert_eq!(expr.object().unwrap(), obj);
29        assert!(expr.is::<ObjectExpression>());
30    }
31}