Skip to content

Commit 98d0e3c

Browse files
gsk: Adapt to moved function
1 parent d8ac485 commit 98d0e3c

File tree

5 files changed

+32
-36
lines changed

5 files changed

+32
-36
lines changed

gsk4/Gir.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ status = "generate"
170170
[[object.function]]
171171
name = "foreach"
172172
manual = true # tries to call from_glib_borrow on an enum
173-
[[object.function]]
174-
name = "point_get_curvature"
175-
manual = true # handle nullable point return value
176173

177174
[[object]]
178175
name = "Gsk.PathBuilder"
@@ -188,7 +185,9 @@ status = "generate"
188185
name = "Gsk.PathPoint"
189186
status = "generate"
190187
boxed_inline = true
191-
188+
[[object.function]]
189+
name = "get_curvature"
190+
manual = true # handle nullable point return value
192191

193192
[[object]]
194193
name = "Gsk.Renderer"

gsk4/src/auto/path_point.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@ impl PathPoint {
3232
}
3333
}
3434

35-
#[doc(alias = "gsk_path_point_get_curvature")]
36-
#[doc(alias = "get_curvature")]
37-
pub fn curvature(&self, path: &Path) -> (f32, Option<graphene::Point>) {
38-
unsafe {
39-
let mut center = graphene::Point::uninitialized();
40-
let ret = ffi::gsk_path_point_get_curvature(
41-
self.to_glib_none().0,
42-
path.to_glib_none().0,
43-
center.to_glib_none_mut().0,
44-
);
45-
(ret, center)
46-
}
47-
}
48-
4935
#[doc(alias = "gsk_path_point_get_position")]
5036
#[doc(alias = "get_position")]
5137
pub fn position(&self, path: &Path) -> graphene::Point {

gsk4/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ mod path;
6767
#[cfg(feature = "v4_14")]
6868
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
6969
mod path_builder;
70+
#[cfg(feature = "v4_14")]
71+
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
72+
mod path_point;
7073
mod radial_gradient_node;
7174
mod repeat_node;
7275
mod repeating_linear_gradient_node;

gsk4/src/path.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use crate::{Path, PathForeachFlags, PathOperation, PathPoint};
3+
use crate::{Path, PathForeachFlags, PathOperation};
44
use glib::translate::*;
55

66
impl Path {
@@ -35,23 +35,6 @@ impl Path {
3535
))
3636
}
3737
}
38-
39-
#[doc(alias = "gsk_path_point_get_curvature")]
40-
pub fn point_get_curvature(&self, point: &PathPoint) -> (f32, Option<graphene::Point>) {
41-
unsafe {
42-
let mut center = graphene::Point::uninitialized();
43-
let ret = ffi::gsk_path_point_get_curvature(
44-
self.to_glib_none().0,
45-
point.to_glib_none().0,
46-
center.to_glib_none_mut().0,
47-
);
48-
if ret == 0.0 {
49-
(ret, None)
50-
} else {
51-
(ret, Some(center))
52-
}
53-
}
54-
}
5538
}
5639

5740
impl std::str::FromStr for Path {

gsk4/src/path_point.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Take a look at the license at the top of the repository in the LICENSE file.
2+
3+
use crate::{Path, PathPoint};
4+
use glib::translate::*;
5+
6+
impl PathPoint {
7+
#[doc(alias = "gsk_path_point_get_curvature")]
8+
#[doc(alias = "get_curvature")]
9+
pub fn curvature(&self, path: &Path) -> (f32, Option<graphene::Point>) {
10+
unsafe {
11+
let mut center = graphene::Point::uninitialized();
12+
let ret = ffi::gsk_path_point_get_curvature(
13+
self.to_glib_none().0,
14+
path.to_glib_none().0,
15+
center.to_glib_none_mut().0,
16+
);
17+
18+
if ret == 0.0 {
19+
(ret, None)
20+
} else {
21+
(ret, Some(center))
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)