gsk4/auto/
inset_shadow_node.rs1use crate::{ffi, RoundedRect};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GskInsetShadowNode")]
10 pub struct InsetShadowNode(Shared<ffi::GskInsetShadowNode>);
11
12 match fn {
13 ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode),
14 unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode),
15 }
16}
17
18impl StaticType for InsetShadowNode {
19 fn static_type() -> glib::Type {
20 unsafe { from_glib(ffi::gsk_inset_shadow_node_get_type()) }
21 }
22}
23
24impl InsetShadowNode {
25 #[doc(alias = "gsk_inset_shadow_node_new")]
26 pub fn new(
27 outline: &RoundedRect,
28 color: &gdk::RGBA,
29 dx: f32,
30 dy: f32,
31 spread: f32,
32 blur_radius: f32,
33 ) -> InsetShadowNode {
34 assert_initialized_main_thread!();
35 unsafe {
36 from_glib_full(ffi::gsk_inset_shadow_node_new(
37 outline.to_glib_none().0,
38 color.to_glib_none().0,
39 dx,
40 dy,
41 spread,
42 blur_radius,
43 ))
44 }
45 }
46
47 #[doc(alias = "gsk_inset_shadow_node_get_blur_radius")]
48 #[doc(alias = "get_blur_radius")]
49 pub fn blur_radius(&self) -> f32 {
50 unsafe { ffi::gsk_inset_shadow_node_get_blur_radius(self.to_glib_none().0) }
51 }
52
53 #[doc(alias = "gsk_inset_shadow_node_get_color")]
54 #[doc(alias = "get_color")]
55 pub fn color(&self) -> gdk::RGBA {
56 unsafe { from_glib_none(ffi::gsk_inset_shadow_node_get_color(self.to_glib_none().0)) }
57 }
58
59 #[doc(alias = "gsk_inset_shadow_node_get_dx")]
60 #[doc(alias = "get_dx")]
61 pub fn dx(&self) -> f32 {
62 unsafe { ffi::gsk_inset_shadow_node_get_dx(self.to_glib_none().0) }
63 }
64
65 #[doc(alias = "gsk_inset_shadow_node_get_dy")]
66 #[doc(alias = "get_dy")]
67 pub fn dy(&self) -> f32 {
68 unsafe { ffi::gsk_inset_shadow_node_get_dy(self.to_glib_none().0) }
69 }
70
71 #[doc(alias = "gsk_inset_shadow_node_get_outline")]
72 #[doc(alias = "get_outline")]
73 pub fn outline(&self) -> RoundedRect {
74 unsafe {
75 from_glib_none(ffi::gsk_inset_shadow_node_get_outline(
76 self.to_glib_none().0,
77 ))
78 }
79 }
80
81 #[doc(alias = "gsk_inset_shadow_node_get_spread")]
82 #[doc(alias = "get_spread")]
83 pub fn spread(&self) -> f32 {
84 unsafe { ffi::gsk_inset_shadow_node_get_spread(self.to_glib_none().0) }
85 }
86}