clutter/auto/
text_node.rs1use crate::{Color, PaintNode};
2use glib::{object::Cast, translate::*};
3use std::fmt;
4
5glib_wrapper! {
6 pub struct TextNode(Object<ffi::ClutterTextNode, ffi::ClutterTextNodeClass, TextNodeClass>) @extends PaintNode;
7
8 match fn {
9 get_type => || ffi::clutter_text_node_get_type(),
10 }
11}
12
13impl TextNode {
14 pub fn new(layout: Option<&pango::Layout>, color: Option<&Color>) -> TextNode {
30 unsafe {
31 PaintNode::from_glib_full(ffi::clutter_text_node_new(
32 layout.to_glib_none().0,
33 color.to_glib_none().0,
34 ))
35 .unsafe_cast()
36 }
37 }
38}
39
40impl fmt::Display for TextNode {
41 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42 write!(f, "TextNode")
43 }
44}