Skip to content

Commit c91cddb

Browse files
gtk4: generate snapshot_append_*_gradient manually
same as append_linear_gradient & append_repeating_linear_gradient
1 parent c117398 commit c91cddb

File tree

3 files changed

+60
-52
lines changed

3 files changed

+60
-52
lines changed

gtk4/Gir.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,9 +1649,17 @@ status = "generate"
16491649
#manual
16501650
ignore = true
16511651
[[object.function]]
1652+
name = "append_radial_gradient"
1653+
#manual
1654+
ignore = true
1655+
[[object.function]]
16521656
name = "append_repeating_linear_gradient"
16531657
#manual
16541658
ignore = true
1659+
[[object.function]]
1660+
name = "append_repeating_radial_gradient"
1661+
#manual
1662+
ignore = true
16551663

16561664
[[object]]
16571665
name = "Gtk.SortListModel"

gtk4/src/auto/snapshot.rs

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -113,58 +113,6 @@ impl Snapshot {
113113
}
114114
}
115115

116-
pub fn append_radial_gradient(
117-
&self,
118-
bounds: &graphene::Rect,
119-
center: &graphene::Point,
120-
hradius: f32,
121-
vradius: f32,
122-
start: f32,
123-
end: f32,
124-
stops: &[&gsk::ColorStop],
125-
) {
126-
let n_stops = stops.len() as usize;
127-
unsafe {
128-
gtk_sys::gtk_snapshot_append_radial_gradient(
129-
self.to_glib_none().0,
130-
bounds.to_glib_none().0,
131-
center.to_glib_none().0,
132-
hradius,
133-
vradius,
134-
start,
135-
end,
136-
stops.to_glib_none().0,
137-
n_stops,
138-
);
139-
}
140-
}
141-
142-
pub fn append_repeating_radial_gradient(
143-
&self,
144-
bounds: &graphene::Rect,
145-
center: &graphene::Point,
146-
hradius: f32,
147-
vradius: f32,
148-
start: f32,
149-
end: f32,
150-
stops: &[&gsk::ColorStop],
151-
) {
152-
let n_stops = stops.len() as usize;
153-
unsafe {
154-
gtk_sys::gtk_snapshot_append_repeating_radial_gradient(
155-
self.to_glib_none().0,
156-
bounds.to_glib_none().0,
157-
center.to_glib_none().0,
158-
hradius,
159-
vradius,
160-
start,
161-
end,
162-
stops.to_glib_none().0,
163-
n_stops,
164-
);
165-
}
166-
}
167-
168116
pub fn append_texture<P: IsA<gdk::Texture>>(&self, texture: &P, bounds: &graphene::Rect) {
169117
unsafe {
170118
gtk_sys::gtk_snapshot_append_texture(

gtk4/src/snapshot.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,58 @@ impl Snapshot {
2929
}
3030
}
3131

32+
pub fn append_radial_gradient(
33+
&self,
34+
bounds: &graphene::Rect,
35+
center: &graphene::Point,
36+
hradius: f32,
37+
vradius: f32,
38+
start: f32,
39+
end: f32,
40+
stops: &[gsk::ColorStop],
41+
) {
42+
let n_stops = stops.len() as usize;
43+
unsafe {
44+
gtk_sys::gtk_snapshot_append_radial_gradient(
45+
self.to_glib_none().0,
46+
bounds.to_glib_none().0,
47+
center.to_glib_none().0,
48+
hradius,
49+
vradius,
50+
start,
51+
end,
52+
stops.to_glib_none().0,
53+
n_stops,
54+
);
55+
}
56+
}
57+
58+
pub fn append_repeating_radial_gradient(
59+
&self,
60+
bounds: &graphene::Rect,
61+
center: &graphene::Point,
62+
hradius: f32,
63+
vradius: f32,
64+
start: f32,
65+
end: f32,
66+
stops: &[gsk::ColorStop],
67+
) {
68+
let n_stops = stops.len() as usize;
69+
unsafe {
70+
gtk_sys::gtk_snapshot_append_repeating_radial_gradient(
71+
self.to_glib_none().0,
72+
bounds.to_glib_none().0,
73+
center.to_glib_none().0,
74+
hradius,
75+
vradius,
76+
start,
77+
end,
78+
stops.to_glib_none().0,
79+
n_stops,
80+
);
81+
}
82+
}
83+
3284
pub fn append_repeating_linear_gradient(
3385
&self,
3486
bounds: &Rect,

0 commit comments

Comments
 (0)