Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #34 from GuillaumeGomez/regen
Browse files Browse the repository at this point in the history
Regen
  • Loading branch information
GuillaumeGomez committed Jul 13, 2019
2 parents d5c34bf + 93a7c3f commit 6fab977
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -15,10 +15,10 @@ matrix:
rust: beta
env: GTK=3.24 FEATURES=
- os: linux
rust: 1.34.0 # to check gstreamer compatibility
rust: 1.36.0
env: GTK=3.14 FEATURES=
- os: linux
rust: 1.34.0 # to check gstreamer compatibility
rust: 1.36.0
env: GTK=3.24 FEATURES=
- os: osx
rust: nightly
Expand Down
2 changes: 1 addition & 1 deletion gir-files
40 changes: 24 additions & 16 deletions src/auto/component.rs
Expand Up @@ -82,18 +82,22 @@ impl<O: IsA<Component>> ComponentExt for O {

fn get_extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32) {
unsafe {
let mut x = mem::uninitialized();
let mut y = mem::uninitialized();
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
atk_sys::atk_component_get_extents(
self.as_ref().to_glib_none().0,
&mut x,
&mut y,
&mut width,
&mut height,
x.as_mut_ptr(),
y.as_mut_ptr(),
width.as_mut_ptr(),
height.as_mut_ptr(),
coord_type.to_glib(),
);
let x = x.assume_init();
let y = y.assume_init();
let width = width.assume_init();
let height = height.assume_init();
(x, y, width, height)
}
}
Expand All @@ -112,27 +116,31 @@ impl<O: IsA<Component>> ComponentExt for O {

fn get_position(&self, coord_type: CoordType) -> (i32, i32) {
unsafe {
let mut x = mem::uninitialized();
let mut y = mem::uninitialized();
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
atk_sys::atk_component_get_position(
self.as_ref().to_glib_none().0,
&mut x,
&mut y,
x.as_mut_ptr(),
y.as_mut_ptr(),
coord_type.to_glib(),
);
let x = x.assume_init();
let y = y.assume_init();
(x, y)
}
}

fn get_size(&self) -> (i32, i32) {
unsafe {
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
atk_sys::atk_component_get_size(
self.as_ref().to_glib_none().0,
&mut width,
&mut height,
width.as_mut_ptr(),
height.as_mut_ptr(),
);
let width = width.assume_init();
let height = height.assume_init();
(width, height)
}
}
Expand Down
20 changes: 12 additions & 8 deletions src/auto/image.rs
Expand Up @@ -51,27 +51,31 @@ impl<O: IsA<Image>> AtkImageExt for O {

fn get_image_position(&self, coord_type: CoordType) -> (i32, i32) {
unsafe {
let mut x = mem::uninitialized();
let mut y = mem::uninitialized();
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
atk_sys::atk_image_get_image_position(
self.as_ref().to_glib_none().0,
&mut x,
&mut y,
x.as_mut_ptr(),
y.as_mut_ptr(),
coord_type.to_glib(),
);
let x = x.assume_init();
let y = y.assume_init();
(x, y)
}
}

fn get_image_size(&self) -> (i32, i32) {
unsafe {
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
atk_sys::atk_image_get_image_size(
self.as_ref().to_glib_none().0,
&mut width,
&mut height,
width.as_mut_ptr(),
height.as_mut_ptr(),
);
let width = width.assume_init();
let height = height.assume_init();
(width, height)
}
}
Expand Down
30 changes: 18 additions & 12 deletions src/auto/table_cell.rs
Expand Up @@ -46,13 +46,15 @@ impl<O: IsA<TableCell>> TableCellExt for O {

fn get_position(&self) -> Option<(i32, i32)> {
unsafe {
let mut row = mem::uninitialized();
let mut column = mem::uninitialized();
let mut row = mem::MaybeUninit::uninit();
let mut column = mem::MaybeUninit::uninit();
let ret = from_glib(atk_sys::atk_table_cell_get_position(
self.as_ref().to_glib_none().0,
&mut row,
&mut column,
row.as_mut_ptr(),
column.as_mut_ptr(),
));
let row = row.assume_init();
let column = column.assume_init();
if ret {
Some((row, column))
} else {
Expand All @@ -63,17 +65,21 @@ impl<O: IsA<TableCell>> TableCellExt for O {

fn get_row_column_span(&self) -> Option<(i32, i32, i32, i32)> {
unsafe {
let mut row = mem::uninitialized();
let mut column = mem::uninitialized();
let mut row_span = mem::uninitialized();
let mut column_span = mem::uninitialized();
let mut row = mem::MaybeUninit::uninit();
let mut column = mem::MaybeUninit::uninit();
let mut row_span = mem::MaybeUninit::uninit();
let mut column_span = mem::MaybeUninit::uninit();
let ret = from_glib(atk_sys::atk_table_cell_get_row_column_span(
self.as_ref().to_glib_none().0,
&mut row,
&mut column,
&mut row_span,
&mut column_span,
row.as_mut_ptr(),
column.as_mut_ptr(),
row_span.as_mut_ptr(),
column_span.as_mut_ptr(),
));
let row = row.assume_init();
let column = column.assume_init();
let row_span = row_span.assume_init();
let column_span = column_span.assume_init();
if ret {
Some((row, column, row_span, column_span))
} else {
Expand Down
50 changes: 30 additions & 20 deletions src/auto/text.rs
Expand Up @@ -158,19 +158,23 @@ impl<O: IsA<Text>> TextExt for O {

fn get_character_extents(&self, offset: i32, coords: CoordType) -> (i32, i32, i32, i32) {
unsafe {
let mut x = mem::uninitialized();
let mut y = mem::uninitialized();
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
atk_sys::atk_text_get_character_extents(
self.as_ref().to_glib_none().0,
offset,
&mut x,
&mut y,
&mut width,
&mut height,
x.as_mut_ptr(),
y.as_mut_ptr(),
width.as_mut_ptr(),
height.as_mut_ptr(),
coords.to_glib(),
);
let x = x.assume_init();
let y = y.assume_init();
let width = width.assume_init();
let height = height.assume_init();
(x, y, width, height)
}
}
Expand Down Expand Up @@ -219,14 +223,16 @@ impl<O: IsA<Text>> TextExt for O {

fn get_selection(&self, selection_num: i32) -> (GString, i32, i32) {
unsafe {
let mut start_offset = mem::uninitialized();
let mut end_offset = mem::uninitialized();
let mut start_offset = mem::MaybeUninit::uninit();
let mut end_offset = mem::MaybeUninit::uninit();
let ret = from_glib_full(atk_sys::atk_text_get_selection(
self.as_ref().to_glib_none().0,
selection_num,
&mut start_offset,
&mut end_offset,
start_offset.as_mut_ptr(),
end_offset.as_mut_ptr(),
));
let start_offset = start_offset.assume_init();
let end_offset = end_offset.assume_init();
(ret, start_offset, end_offset)
}
}
Expand All @@ -237,15 +243,17 @@ impl<O: IsA<Text>> TextExt for O {
granularity: TextGranularity,
) -> (Option<GString>, i32, i32) {
unsafe {
let mut start_offset = mem::uninitialized();
let mut end_offset = mem::uninitialized();
let mut start_offset = mem::MaybeUninit::uninit();
let mut end_offset = mem::MaybeUninit::uninit();
let ret = from_glib_full(atk_sys::atk_text_get_string_at_offset(
self.as_ref().to_glib_none().0,
offset,
granularity.to_glib(),
&mut start_offset,
&mut end_offset,
start_offset.as_mut_ptr(),
end_offset.as_mut_ptr(),
));
let start_offset = start_offset.assume_init();
let end_offset = end_offset.assume_init();
(ret, start_offset, end_offset)
}
}
Expand All @@ -262,15 +270,17 @@ impl<O: IsA<Text>> TextExt for O {

fn get_text_at_offset(&self, offset: i32, boundary_type: TextBoundary) -> (GString, i32, i32) {
unsafe {
let mut start_offset = mem::uninitialized();
let mut end_offset = mem::uninitialized();
let mut start_offset = mem::MaybeUninit::uninit();
let mut end_offset = mem::MaybeUninit::uninit();
let ret = from_glib_full(atk_sys::atk_text_get_text_at_offset(
self.as_ref().to_glib_none().0,
offset,
boundary_type.to_glib(),
&mut start_offset,
&mut end_offset,
start_offset.as_mut_ptr(),
end_offset.as_mut_ptr(),
));
let start_offset = start_offset.assume_init();
let end_offset = end_offset.assume_init();
(ret, start_offset, end_offset)
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/auto/value.rs
Expand Up @@ -116,13 +116,14 @@ impl<O: IsA<Value>> ValueExt for O {

fn get_value_and_text(&self) -> (f64, GString) {
unsafe {
let mut value = mem::uninitialized();
let mut value = mem::MaybeUninit::uninit();
let mut text = ptr::null_mut();
atk_sys::atk_value_get_value_and_text(
self.as_ref().to_glib_none().0,
&mut value,
value.as_mut_ptr(),
&mut text,
);
let value = value.assume_init();
(value, from_glib_full(text))
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/auto/versions.txt
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ a080a17)
from gir-files (https://github.com/gtk-rs/gir-files @ 6b1fe0b)
Generated by gir (https://github.com/gtk-rs/gir @ dffd787)
from gir-files (https://github.com/gtk-rs/gir-files @ 8befbe7)

0 comments on commit 6fab977

Please sign in to comment.