Skip to content

Commit b9e56ec

Browse files
Adapt to gtk-rs/gir#1530
1 parent 3ecaedc commit b9e56ec

File tree

5 files changed

+10
-56
lines changed

5 files changed

+10
-56
lines changed

gdk4/src/toplevel_size.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ use std::fmt;
44

55
use glib::translate::*;
66

7-
glib::wrapper! {
7+
use std::ptr::NonNull;
88

9+
#[repr(transparent)]
910
#[doc(alias = "GdkToplevelSize")]
10-
pub struct ToplevelSize(BoxedInline<ffi::GdkToplevelSize>);
11+
pub struct ToplevelSize(NonNull<ffi::GdkToplevelSize>);
1112

12-
match fn {
13-
type_ => || ffi::gdk_toplevel_size_get_type(),
13+
impl glib::StaticType for ToplevelSize {
14+
fn static_type() -> glib::Type {
15+
unsafe { from_glib(ffi::gdk_toplevel_size_get_type()) }
1416
}
15-
1617
}
1718

1819
impl ToplevelSize {
@@ -24,7 +25,7 @@ impl ToplevelSize {
2425
let mut bounds_height = std::mem::MaybeUninit::uninit();
2526

2627
ffi::gdk_toplevel_size_get_bounds(
27-
self.to_glib_none().0 as *mut _,
28+
self.0.as_ptr(),
2829
bounds_width.as_mut_ptr(),
2930
bounds_height.as_mut_ptr(),
3031
);
@@ -35,27 +36,21 @@ impl ToplevelSize {
3536
#[doc(alias = "gdk_toplevel_size_set_min_size")]
3637
pub fn set_min_size(&mut self, min_width: i32, min_height: i32) {
3738
unsafe {
38-
ffi::gdk_toplevel_size_set_min_size(self.to_glib_none_mut().0, min_width, min_height);
39+
ffi::gdk_toplevel_size_set_min_size(self.0.as_mut(), min_width, min_height);
3940
}
4041
}
4142

4243
#[doc(alias = "gdk_toplevel_size_set_shadow_width")]
4344
pub fn set_shadow_width(&mut self, left: i32, right: i32, top: i32, bottom: i32) {
4445
unsafe {
45-
ffi::gdk_toplevel_size_set_shadow_width(
46-
self.to_glib_none_mut().0,
47-
left,
48-
right,
49-
top,
50-
bottom,
51-
);
46+
ffi::gdk_toplevel_size_set_shadow_width(self.0.as_mut(), left, right, top, bottom);
5247
}
5348
}
5449

5550
#[doc(alias = "gdk_toplevel_size_set_size")]
5651
pub fn set_size(&mut self, width: i32, height: i32) {
5752
unsafe {
58-
ffi::gdk_toplevel_size_set_size(self.to_glib_none_mut().0, width, height);
53+
ffi::gdk_toplevel_size_set_size(self.0.as_mut(), width, height);
5954
}
6055
}
6156
}

gtk4/src/subclass/constraint_target.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

gtk4/src/subclass/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub mod cell_renderer_text;
3737
pub mod check_button;
3838
pub mod color_chooser;
3939
pub mod combo_box;
40-
pub mod constraint_target;
4140
pub mod dialog;
4241
pub mod drawing_area;
4342
pub mod editable;
@@ -56,15 +55,13 @@ pub mod layout_manager;
5655
pub mod list_box_row;
5756
pub mod media_file;
5857
pub mod media_stream;
59-
pub mod native;
6058
pub mod native_dialog;
6159
pub mod orientable;
6260
pub mod popover;
6361
pub mod print_operation;
6462
pub mod print_operation_preview;
6563
pub mod range;
6664
pub mod recent_manager;
67-
pub mod root;
6865
pub mod scale;
6966
pub mod scale_button;
7067
pub mod scrollable;
@@ -126,7 +123,6 @@ pub mod prelude {
126123
check_button::{CheckButtonImpl, CheckButtonImplExt},
127124
color_chooser::{ColorChooserImpl, ColorChooserImplExt},
128125
combo_box::{ComboBoxImpl, ComboBoxImplExt},
129-
constraint_target::ConstraintTargetImpl,
130126
dialog::{DialogImpl, DialogImplExt},
131127
drawing_area::{DrawingAreaImpl, DrawingAreaImplExt},
132128
editable::{EditableImpl, EditableImplExt},
@@ -145,15 +141,13 @@ pub mod prelude {
145141
list_box_row::{ListBoxRowImpl, ListBoxRowImplExt},
146142
media_file::{MediaFileImpl, MediaFileImplExt},
147143
media_stream::{MediaStreamImpl, MediaStreamImplExt},
148-
native::NativeImpl,
149144
native_dialog::{NativeDialogImpl, NativeDialogImplExt},
150145
orientable::OrientableImpl,
151146
popover::{PopoverImpl, PopoverImplExt},
152147
print_operation::{PrintOperationImpl, PrintOperationImplExt},
153148
print_operation_preview::PrintOperationPreviewImpl,
154149
range::{RangeImpl, RangeImplExt},
155150
recent_manager::{RecentManagerImpl, RecentManagerImplExt},
156-
root::RootImpl,
157151
scale::{ScaleImpl, ScaleImplExt},
158152
scale_button::{ScaleButtonImpl, ScaleButtonImplExt},
159153
scrollable::{ScrollableImpl, ScrollableImplExt},

gtk4/src/subclass/native.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

gtk4/src/subclass/root.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)