Skip to content

Commit 15e52f2

Browse files
committed
gir: Update and regenerate with impl Trait instead of named types
gtk-rs/gir#1153
1 parent 447b357 commit 15e52f2

File tree

259 files changed

+4285
-5516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+4285
-5516
lines changed

gdk4-x11/src/auto/x11_device_manager_xi2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl X11DeviceManagerXI2Builder {
120120
.expect("Failed to create an instance of X11DeviceManagerXI2")
121121
}
122122

123-
pub fn display<P: IsA<gdk::Display>>(mut self, display: &P) -> Self {
123+
pub fn display(mut self, display: &impl IsA<gdk::Display>) -> Self {
124124
self.display = Some(display.clone().upcast());
125125
self
126126
}

gdk4-x11/src/auto/x11_device_xi2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl X11DeviceXI2Builder {
9898
self
9999
}
100100

101-
pub fn display<P: IsA<gdk::Display>>(mut self, display: &P) -> Self {
101+
pub fn display(mut self, display: &impl IsA<gdk::Display>) -> Self {
102102
self.display = Some(display.clone().upcast());
103103
self
104104
}

gdk4-x11/src/auto/x11_display.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl X11Display {
220220
}
221221

222222
#[doc(alias = "gdk_x11_display_set_program_class")]
223-
pub fn set_program_class<P: IsA<gdk::Display>>(display: &P, program_class: &str) {
223+
pub fn set_program_class(display: &impl IsA<gdk::Display>, program_class: &str) {
224224
assert_initialized_main_thread!();
225225
unsafe {
226226
ffi::gdk_x11_display_set_program_class(

gdk4-x11/src/auto/x11_screen.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ impl X11Screen {
6565
}
6666

6767
#[doc(alias = "window-manager-changed")]
68-
pub fn connect_window_manager_changed<F: Fn(&X11Screen) + 'static>(
69-
&self,
70-
f: F,
71-
) -> SignalHandlerId {
68+
pub fn connect_window_manager_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
7269
unsafe extern "C" fn window_manager_changed_trampoline<F: Fn(&X11Screen) + 'static>(
7370
this: *mut ffi::GdkX11Screen,
7471
f: glib::ffi::gpointer,

gdk4-x11/src/auto/x11_surface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl X11Surface {
6060
}
6161

6262
#[doc(alias = "gdk_x11_surface_set_group")]
63-
pub fn set_group<P: IsA<gdk::Surface>>(&self, leader: &P) {
63+
pub fn set_group(&self, leader: &impl IsA<gdk::Surface>) {
6464
unsafe {
6565
ffi::gdk_x11_surface_set_group(self.to_glib_none().0, leader.as_ref().to_glib_none().0);
6666
}

gdk4/src/auto/app_launch_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl AppLaunchContext {
4444
}
4545

4646
#[doc(alias = "gdk_app_launch_context_set_icon")]
47-
pub fn set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>) {
47+
pub fn set_icon(&self, icon: Option<&impl IsA<gio::Icon>>) {
4848
unsafe {
4949
ffi::gdk_app_launch_context_set_icon(
5050
self.to_glib_none().0,

gdk4/src/auto/clipboard.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ impl Clipboard {
5858
}
5959

6060
#[doc(alias = "gdk_clipboard_set_content")]
61-
pub fn set_content<P: IsA<ContentProvider>>(
61+
pub fn set_content(
6262
&self,
63-
provider: Option<&P>,
63+
provider: Option<&impl IsA<ContentProvider>>,
6464
) -> Result<(), glib::error::BoolError> {
6565
unsafe {
6666
glib::result_from_gboolean!(
@@ -81,7 +81,7 @@ impl Clipboard {
8181
}
8282

8383
#[doc(alias = "gdk_clipboard_set_texture")]
84-
pub fn set_texture<P: IsA<Texture>>(&self, texture: &P) {
84+
pub fn set_texture(&self, texture: &impl IsA<Texture>) {
8585
unsafe {
8686
ffi::gdk_clipboard_set_texture(
8787
self.to_glib_none().0,
@@ -91,7 +91,7 @@ impl Clipboard {
9191
}
9292

9393
#[doc(alias = "changed")]
94-
pub fn connect_changed<F: Fn(&Clipboard) + 'static>(&self, f: F) -> SignalHandlerId {
94+
pub fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
9595
unsafe extern "C" fn changed_trampoline<F: Fn(&Clipboard) + 'static>(
9696
this: *mut ffi::GdkClipboard,
9797
f: glib::ffi::gpointer,
@@ -113,7 +113,7 @@ impl Clipboard {
113113
}
114114

115115
#[doc(alias = "content")]
116-
pub fn connect_content_notify<F: Fn(&Clipboard) + 'static>(&self, f: F) -> SignalHandlerId {
116+
pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
117117
unsafe extern "C" fn notify_content_trampoline<F: Fn(&Clipboard) + 'static>(
118118
this: *mut ffi::GdkClipboard,
119119
_param_spec: glib::ffi::gpointer,
@@ -136,7 +136,7 @@ impl Clipboard {
136136
}
137137

138138
#[doc(alias = "formats")]
139-
pub fn connect_formats_notify<F: Fn(&Clipboard) + 'static>(&self, f: F) -> SignalHandlerId {
139+
pub fn connect_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
140140
unsafe extern "C" fn notify_formats_trampoline<F: Fn(&Clipboard) + 'static>(
141141
this: *mut ffi::GdkClipboard,
142142
_param_spec: glib::ffi::gpointer,
@@ -159,7 +159,7 @@ impl Clipboard {
159159
}
160160

161161
#[doc(alias = "local")]
162-
pub fn connect_local_notify<F: Fn(&Clipboard) + 'static>(&self, f: F) -> SignalHandlerId {
162+
pub fn connect_local_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
163163
unsafe extern "C" fn notify_local_trampoline<F: Fn(&Clipboard) + 'static>(
164164
this: *mut ffi::GdkClipboard,
165165
_param_spec: glib::ffi::gpointer,

gdk4/src/auto/content_provider.rs

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,19 @@ pub trait ContentProviderExt: 'static {
7474
fn storable_formats(&self) -> ContentFormats;
7575

7676
#[doc(alias = "gdk_content_provider_write_mime_type_async")]
77-
fn write_mime_type_async<
78-
P: IsA<gio::OutputStream>,
79-
Q: IsA<gio::Cancellable>,
80-
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
81-
>(
77+
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + Send + 'static>(
8278
&self,
8379
mime_type: &str,
84-
stream: &P,
80+
stream: &impl IsA<gio::OutputStream>,
8581
io_priority: glib::Priority,
86-
cancellable: Option<&Q>,
87-
callback: R,
82+
cancellable: Option<&impl IsA<gio::Cancellable>>,
83+
callback: P,
8884
);
8985

90-
fn write_mime_type_async_future<P: IsA<gio::OutputStream> + Clone + 'static>(
86+
fn write_mime_type_async_future(
9187
&self,
9288
mime_type: &str,
93-
stream: &P,
89+
stream: &(impl IsA<gio::OutputStream> + Clone + 'static),
9490
io_priority: glib::Priority,
9591
) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>>;
9692

@@ -127,21 +123,17 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
127123
}
128124
}
129125

130-
fn write_mime_type_async<
131-
P: IsA<gio::OutputStream>,
132-
Q: IsA<gio::Cancellable>,
133-
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
134-
>(
126+
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + Send + 'static>(
135127
&self,
136128
mime_type: &str,
137-
stream: &P,
129+
stream: &impl IsA<gio::OutputStream>,
138130
io_priority: glib::Priority,
139-
cancellable: Option<&Q>,
140-
callback: R,
131+
cancellable: Option<&impl IsA<gio::Cancellable>>,
132+
callback: P,
141133
) {
142-
let user_data: Box_<R> = Box_::new(callback);
134+
let user_data: Box_<P> = Box_::new(callback);
143135
unsafe extern "C" fn write_mime_type_async_trampoline<
144-
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
136+
P: FnOnce(Result<(), glib::Error>) + Send + 'static,
145137
>(
146138
_source_object: *mut glib::gobject_ffi::GObject,
147139
res: *mut gio::ffi::GAsyncResult,
@@ -158,10 +150,10 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
158150
} else {
159151
Err(from_glib_full(error))
160152
};
161-
let callback: Box_<R> = Box_::from_raw(user_data as *mut _);
153+
let callback: Box_<P> = Box_::from_raw(user_data as *mut _);
162154
callback(result);
163155
}
164-
let callback = write_mime_type_async_trampoline::<R>;
156+
let callback = write_mime_type_async_trampoline::<P>;
165157
unsafe {
166158
ffi::gdk_content_provider_write_mime_type_async(
167159
self.as_ref().to_glib_none().0,
@@ -175,10 +167,10 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
175167
}
176168
}
177169

178-
fn write_mime_type_async_future<P: IsA<gio::OutputStream> + Clone + 'static>(
170+
fn write_mime_type_async_future(
179171
&self,
180172
mime_type: &str,
181-
stream: &P,
173+
stream: &(impl IsA<gio::OutputStream> + Clone + 'static),
182174
io_priority: glib::Priority,
183175
) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> {
184176
let mime_type = String::from(mime_type);
@@ -201,12 +193,13 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
201193

202194
#[doc(alias = "content-changed")]
203195
fn connect_content_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
204-
unsafe extern "C" fn content_changed_trampoline<P, F: Fn(&P) + 'static>(
196+
unsafe extern "C" fn content_changed_trampoline<
197+
P: IsA<ContentProvider>,
198+
F: Fn(&P) + 'static,
199+
>(
205200
this: *mut ffi::GdkContentProvider,
206201
f: glib::ffi::gpointer,
207-
) where
208-
P: IsA<ContentProvider>,
209-
{
202+
) {
210203
let f: &F = &*(f as *const F);
211204
f(&ContentProvider::from_glib_borrow(this).unsafe_cast_ref())
212205
}
@@ -225,13 +218,14 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
225218

226219
#[doc(alias = "formats")]
227220
fn connect_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
228-
unsafe extern "C" fn notify_formats_trampoline<P, F: Fn(&P) + 'static>(
221+
unsafe extern "C" fn notify_formats_trampoline<
222+
P: IsA<ContentProvider>,
223+
F: Fn(&P) + 'static,
224+
>(
229225
this: *mut ffi::GdkContentProvider,
230226
_param_spec: glib::ffi::gpointer,
231227
f: glib::ffi::gpointer,
232-
) where
233-
P: IsA<ContentProvider>,
234-
{
228+
) {
235229
let f: &F = &*(f as *const F);
236230
f(&ContentProvider::from_glib_borrow(this).unsafe_cast_ref())
237231
}
@@ -250,13 +244,14 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
250244

251245
#[doc(alias = "storable-formats")]
252246
fn connect_storable_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
253-
unsafe extern "C" fn notify_storable_formats_trampoline<P, F: Fn(&P) + 'static>(
247+
unsafe extern "C" fn notify_storable_formats_trampoline<
248+
P: IsA<ContentProvider>,
249+
F: Fn(&P) + 'static,
250+
>(
254251
this: *mut ffi::GdkContentProvider,
255252
_param_spec: glib::ffi::gpointer,
256253
f: glib::ffi::gpointer,
257-
) where
258-
P: IsA<ContentProvider>,
259-
{
254+
) {
260255
let f: &F = &*(f as *const F);
261256
f(&ContentProvider::from_glib_borrow(this).unsafe_cast_ref())
262257
}

gdk4/src/auto/cursor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ impl Cursor {
3333

3434
#[doc(alias = "gdk_cursor_new_from_texture")]
3535
#[doc(alias = "new_from_texture")]
36-
pub fn from_texture<P: IsA<Texture>>(
37-
texture: &P,
36+
pub fn from_texture(
37+
texture: &impl IsA<Texture>,
3838
hotspot_x: i32,
3939
hotspot_y: i32,
4040
fallback: Option<&Cursor>,
@@ -148,7 +148,7 @@ impl CursorBuilder {
148148
self
149149
}
150150

151-
pub fn texture<P: IsA<Texture>>(mut self, texture: &P) -> Self {
151+
pub fn texture(mut self, texture: &impl IsA<Texture>) -> Self {
152152
self.texture = Some(texture.clone().upcast());
153153
self
154154
}

gdk4/src/auto/device.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl Device {
174174
}
175175

176176
#[doc(alias = "changed")]
177-
pub fn connect_changed<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
177+
pub fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
178178
unsafe extern "C" fn changed_trampoline<F: Fn(&Device) + 'static>(
179179
this: *mut ffi::GdkDevice,
180180
f: glib::ffi::gpointer,
@@ -196,7 +196,7 @@ impl Device {
196196
}
197197

198198
#[doc(alias = "tool-changed")]
199-
pub fn connect_tool_changed<F: Fn(&Device, &DeviceTool) + 'static>(
199+
pub fn connect_tool_changed<F: Fn(&Self, &DeviceTool) + 'static>(
200200
&self,
201201
f: F,
202202
) -> SignalHandlerId {
@@ -222,10 +222,7 @@ impl Device {
222222
}
223223

224224
#[doc(alias = "caps-lock-state")]
225-
pub fn connect_caps_lock_state_notify<F: Fn(&Device) + 'static>(
226-
&self,
227-
f: F,
228-
) -> SignalHandlerId {
225+
pub fn connect_caps_lock_state_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
229226
unsafe extern "C" fn notify_caps_lock_state_trampoline<F: Fn(&Device) + 'static>(
230227
this: *mut ffi::GdkDevice,
231228
_param_spec: glib::ffi::gpointer,
@@ -248,7 +245,7 @@ impl Device {
248245
}
249246

250247
#[doc(alias = "direction")]
251-
pub fn connect_direction_notify<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
248+
pub fn connect_direction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
252249
unsafe extern "C" fn notify_direction_trampoline<F: Fn(&Device) + 'static>(
253250
this: *mut ffi::GdkDevice,
254251
_param_spec: glib::ffi::gpointer,
@@ -271,10 +268,7 @@ impl Device {
271268
}
272269

273270
#[doc(alias = "has-bidi-layouts")]
274-
pub fn connect_has_bidi_layouts_notify<F: Fn(&Device) + 'static>(
275-
&self,
276-
f: F,
277-
) -> SignalHandlerId {
271+
pub fn connect_has_bidi_layouts_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
278272
unsafe extern "C" fn notify_has_bidi_layouts_trampoline<F: Fn(&Device) + 'static>(
279273
this: *mut ffi::GdkDevice,
280274
_param_spec: glib::ffi::gpointer,
@@ -297,7 +291,7 @@ impl Device {
297291
}
298292

299293
#[doc(alias = "modifier-state")]
300-
pub fn connect_modifier_state_notify<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
294+
pub fn connect_modifier_state_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
301295
unsafe extern "C" fn notify_modifier_state_trampoline<F: Fn(&Device) + 'static>(
302296
this: *mut ffi::GdkDevice,
303297
_param_spec: glib::ffi::gpointer,
@@ -320,7 +314,7 @@ impl Device {
320314
}
321315

322316
#[doc(alias = "n-axes")]
323-
pub fn connect_n_axes_notify<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
317+
pub fn connect_n_axes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
324318
unsafe extern "C" fn notify_n_axes_trampoline<F: Fn(&Device) + 'static>(
325319
this: *mut ffi::GdkDevice,
326320
_param_spec: glib::ffi::gpointer,
@@ -343,7 +337,7 @@ impl Device {
343337
}
344338

345339
#[doc(alias = "num-lock-state")]
346-
pub fn connect_num_lock_state_notify<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
340+
pub fn connect_num_lock_state_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
347341
unsafe extern "C" fn notify_num_lock_state_trampoline<F: Fn(&Device) + 'static>(
348342
this: *mut ffi::GdkDevice,
349343
_param_spec: glib::ffi::gpointer,
@@ -366,7 +360,7 @@ impl Device {
366360
}
367361

368362
#[doc(alias = "scroll-lock-state")]
369-
pub fn connect_scroll_lock_state_notify<F: Fn(&Device) + 'static>(
363+
pub fn connect_scroll_lock_state_notify<F: Fn(&Self) + 'static>(
370364
&self,
371365
f: F,
372366
) -> SignalHandlerId {
@@ -392,7 +386,7 @@ impl Device {
392386
}
393387

394388
#[doc(alias = "seat")]
395-
pub fn connect_seat_notify<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
389+
pub fn connect_seat_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
396390
unsafe extern "C" fn notify_seat_trampoline<F: Fn(&Device) + 'static>(
397391
this: *mut ffi::GdkDevice,
398392
_param_spec: glib::ffi::gpointer,
@@ -415,7 +409,7 @@ impl Device {
415409
}
416410

417411
#[doc(alias = "tool")]
418-
pub fn connect_tool_notify<F: Fn(&Device) + 'static>(&self, f: F) -> SignalHandlerId {
412+
pub fn connect_tool_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
419413
unsafe extern "C" fn notify_tool_trampoline<F: Fn(&Device) + 'static>(
420414
this: *mut ffi::GdkDevice,
421415
_param_spec: glib::ffi::gpointer,

0 commit comments

Comments
 (0)