gsk4/auto/
inset_shadow_node.rs
1use crate::{ffi, RoundedRect};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GskInsetShadowNode")]
11 pub struct InsetShadowNode(Shared<ffi::GskInsetShadowNode>);
12
13 match fn {
14 ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode),
15 unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode),
16 }
17}
18
19impl StaticType for InsetShadowNode {
20 fn static_type() -> glib::Type {
21 unsafe { from_glib(ffi::gsk_inset_shadow_node_get_type()) }
22 }
23}
24
25impl InsetShadowNode {
26 #[doc(alias = "gsk_inset_shadow_node_new")]
45 pub fn new(
46 outline: &RoundedRect,
47 color: &gdk::RGBA,
48 dx: f32,
49 dy: f32,
50 spread: f32,
51 blur_radius: f32,
52 ) -> InsetShadowNode {
53 assert_initialized_main_thread!();
54 unsafe {
55 from_glib_full(ffi::gsk_inset_shadow_node_new(
56 outline.to_glib_none().0,
57 color.to_glib_none().0,
58 dx,
59 dy,
60 spread,
61 blur_radius,
62 ))
63 }
64 }
65
66 #[doc(alias = "gsk_inset_shadow_node_get_blur_radius")]
72 #[doc(alias = "get_blur_radius")]
73 pub fn blur_radius(&self) -> f32 {
74 unsafe { ffi::gsk_inset_shadow_node_get_blur_radius(self.to_glib_none().0) }
75 }
76
77 #[doc(alias = "gsk_inset_shadow_node_get_color")]
86 #[doc(alias = "get_color")]
87 pub fn color(&self) -> gdk::RGBA {
88 unsafe { from_glib_none(ffi::gsk_inset_shadow_node_get_color(self.to_glib_none().0)) }
89 }
90
91 #[doc(alias = "gsk_inset_shadow_node_get_dx")]
97 #[doc(alias = "get_dx")]
98 pub fn dx(&self) -> f32 {
99 unsafe { ffi::gsk_inset_shadow_node_get_dx(self.to_glib_none().0) }
100 }
101
102 #[doc(alias = "gsk_inset_shadow_node_get_dy")]
108 #[doc(alias = "get_dy")]
109 pub fn dy(&self) -> f32 {
110 unsafe { ffi::gsk_inset_shadow_node_get_dy(self.to_glib_none().0) }
111 }
112
113 #[doc(alias = "gsk_inset_shadow_node_get_outline")]
119 #[doc(alias = "get_outline")]
120 pub fn outline(&self) -> RoundedRect {
121 unsafe {
122 from_glib_none(ffi::gsk_inset_shadow_node_get_outline(
123 self.to_glib_none().0,
124 ))
125 }
126 }
127
128 #[doc(alias = "gsk_inset_shadow_node_get_spread")]
134 #[doc(alias = "get_spread")]
135 pub fn spread(&self) -> f32 {
136 unsafe { ffi::gsk_inset_shadow_node_get_spread(self.to_glib_none().0) }
137 }
138}