Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix glyph string analysis methods that don't need &mut #1188

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pango/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ concurrency = "send+sync"
[[object.function.parameter]]
name = "glyphs"
const = true
[[object.function]]
pattern = "(index_to_x|x_to_index)"
[[object.function.parameter]]
name = "analysis"
const = true

[[object]]
name = "Pango.Language"
Expand Down
14 changes: 4 additions & 10 deletions pango/src/auto/glyph_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,15 @@ impl GlyphString {
}

#[doc(alias = "pango_glyph_string_index_to_x")]
pub fn index_to_x(
&self,
text: &str,
analysis: &mut Analysis,
index_: i32,
trailing: bool,
) -> i32 {
pub fn index_to_x(&self, text: &str, analysis: &Analysis, index_: i32, trailing: bool) -> i32 {
let length = text.len() as _;
unsafe {
let mut x_pos = mem::MaybeUninit::uninit();
ffi::pango_glyph_string_index_to_x(
mut_override(self.to_glib_none().0),
text.to_glib_none().0,
length,
analysis.to_glib_none_mut().0,
mut_override(analysis.to_glib_none().0),
index_,
trailing.into_glib(),
x_pos.as_mut_ptr(),
Expand All @@ -105,7 +99,7 @@ impl GlyphString {
}

#[doc(alias = "pango_glyph_string_x_to_index")]
pub fn x_to_index(&self, text: &str, analysis: &mut Analysis, x_pos: i32) -> (i32, i32) {
pub fn x_to_index(&self, text: &str, analysis: &Analysis, x_pos: i32) -> (i32, i32) {
let length = text.len() as _;
unsafe {
let mut index_ = mem::MaybeUninit::uninit();
Expand All @@ -114,7 +108,7 @@ impl GlyphString {
mut_override(self.to_glib_none().0),
text.to_glib_none().0,
length,
analysis.to_glib_none_mut().0,
mut_override(analysis.to_glib_none().0),
x_pos,
index_.as_mut_ptr(),
trailing.as_mut_ptr(),
Expand Down
Loading