Skip to content
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
2 changes: 1 addition & 1 deletion gdk4-wayland/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 545d89f)
Generated by gir (https://github.com/gtk-rs/gir @ ede0c31)
from gir-files (https://github.com/gtk-rs/gir-files.git @ 38b7451)
2 changes: 1 addition & 1 deletion gdk4-wayland/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 545d89f)
Generated by gir (https://github.com/gtk-rs/gir @ ede0c31)
from gir-files (https://github.com/gtk-rs/gir-files.git @ 38b7451)
2 changes: 1 addition & 1 deletion gdk4-x11/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 545d89f)
Generated by gir (https://github.com/gtk-rs/gir @ ede0c31)
from gir-files (https://github.com/gtk-rs/gir-files.git @ 38b7451)
2 changes: 1 addition & 1 deletion gdk4-x11/src/auto/x11_device_manager_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl X11DeviceManagerXI2Builder {
.expect("Failed to create an instance of X11DeviceManagerXI2")
}

pub fn display<P: IsA<gdk::Display>>(mut self, display: &P) -> Self {
pub fn display(mut self, display: &impl IsA<gdk::Display>) -> Self {
self.display = Some(display.clone().upcast());
self
}
Expand Down
2 changes: 1 addition & 1 deletion gdk4-x11/src/auto/x11_device_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl X11DeviceXI2Builder {
self
}

pub fn display<P: IsA<gdk::Display>>(mut self, display: &P) -> Self {
pub fn display(mut self, display: &impl IsA<gdk::Display>) -> Self {
self.display = Some(display.clone().upcast());
self
}
Expand Down
2 changes: 1 addition & 1 deletion gdk4-x11/src/auto/x11_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl X11Display {
}

#[doc(alias = "gdk_x11_display_set_program_class")]
pub fn set_program_class<P: IsA<gdk::Display>>(display: &P, program_class: &str) {
pub fn set_program_class(display: &impl IsA<gdk::Display>, program_class: &str) {
assert_initialized_main_thread!();
unsafe {
ffi::gdk_x11_display_set_program_class(
Expand Down
2 changes: 1 addition & 1 deletion gdk4-x11/src/auto/x11_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl X11Surface {
}

#[doc(alias = "gdk_x11_surface_set_group")]
pub fn set_group<P: IsA<gdk::Surface>>(&self, leader: &P) {
pub fn set_group(&self, leader: &impl IsA<gdk::Surface>) {
unsafe {
ffi::gdk_x11_surface_set_group(self.to_glib_none().0, leader.as_ref().to_glib_none().0);
}
Expand Down
2 changes: 1 addition & 1 deletion gdk4-x11/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 545d89f)
Generated by gir (https://github.com/gtk-rs/gir @ ede0c31)
from gir-files (https://github.com/gtk-rs/gir-files.git @ 38b7451)
4 changes: 2 additions & 2 deletions gdk4/src/auto/app_launch_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait AppLaunchContextExt: 'static {
fn set_desktop(&self, desktop: i32);

#[doc(alias = "gdk_app_launch_context_set_icon")]
fn set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>);
fn set_icon(&self, icon: Option<&impl IsA<gio::Icon>>);

#[doc(alias = "gdk_app_launch_context_set_icon_name")]
fn set_icon_name(&self, icon_name: Option<&str>);
Expand All @@ -51,7 +51,7 @@ impl<O: IsA<AppLaunchContext>> AppLaunchContextExt for O {
}
}

fn set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>) {
fn set_icon(&self, icon: Option<&impl IsA<gio::Icon>>) {
unsafe {
ffi::gdk_app_launch_context_set_icon(
self.as_ref().to_glib_none().0,
Expand Down
8 changes: 4 additions & 4 deletions gdk4/src/auto/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ impl Clipboard {
}

#[doc(alias = "gdk_clipboard_set_content")]
pub fn set_content<P: IsA<ContentProvider>>(
pub fn set_content(
&self,
provider: Option<&P>,
provider: Option<&impl IsA<ContentProvider>>,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
Expand All @@ -83,7 +83,7 @@ impl Clipboard {
}

#[doc(alias = "gdk_clipboard_set_texture")]
pub fn set_texture<P: IsA<Texture>>(&self, texture: &P) {
pub fn set_texture(&self, texture: &impl IsA<Texture>) {
unsafe {
ffi::gdk_clipboard_set_texture(
self.to_glib_none().0,
Expand Down Expand Up @@ -211,7 +211,7 @@ impl ClipboardBuilder {
.expect("Failed to create an instance of Clipboard")
}

pub fn display<P: IsA<Display>>(mut self, display: &P) -> Self {
pub fn display(mut self, display: &impl IsA<Display>) -> Self {
self.display = Some(display.clone().upcast());
self
}
Expand Down
40 changes: 16 additions & 24 deletions gdk4/src/auto/content_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,19 @@ pub trait ContentProviderExt: 'static {
fn storable_formats(&self) -> ContentFormats;

#[doc(alias = "gdk_content_provider_write_mime_type_async")]
fn write_mime_type_async<
P: IsA<gio::OutputStream>,
Q: IsA<gio::Cancellable>,
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
>(
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + Send + 'static>(
&self,
mime_type: &str,
stream: &P,
stream: &impl IsA<gio::OutputStream>,
io_priority: glib::Priority,
cancellable: Option<&Q>,
callback: R,
cancellable: Option<&impl IsA<gio::Cancellable>>,
callback: P,
);

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

Expand Down Expand Up @@ -128,21 +124,17 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
}
}

fn write_mime_type_async<
P: IsA<gio::OutputStream>,
Q: IsA<gio::Cancellable>,
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
>(
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + Send + 'static>(
&self,
mime_type: &str,
stream: &P,
stream: &impl IsA<gio::OutputStream>,
io_priority: glib::Priority,
cancellable: Option<&Q>,
callback: R,
cancellable: Option<&impl IsA<gio::Cancellable>>,
callback: P,
) {
let user_data: Box_<R> = Box_::new(callback);
let user_data: Box_<P> = Box_::new(callback);
unsafe extern "C" fn write_mime_type_async_trampoline<
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
P: FnOnce(Result<(), glib::Error>) + Send + 'static,
>(
_source_object: *mut glib::gobject_ffi::GObject,
res: *mut gio::ffi::GAsyncResult,
Expand All @@ -159,10 +151,10 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
} else {
Err(from_glib_full(error))
};
let callback: Box_<R> = Box_::from_raw(user_data as *mut _);
let callback: Box_<P> = Box_::from_raw(user_data as *mut _);
callback(result);
}
let callback = write_mime_type_async_trampoline::<R>;
let callback = write_mime_type_async_trampoline::<P>;
unsafe {
ffi::gdk_content_provider_write_mime_type_async(
self.as_ref().to_glib_none().0,
Expand All @@ -176,10 +168,10 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
}
}

fn write_mime_type_async_future<P: IsA<gio::OutputStream> + Clone + 'static>(
fn write_mime_type_async_future(
&self,
mime_type: &str,
stream: &P,
stream: &(impl IsA<gio::OutputStream> + Clone + 'static),
io_priority: glib::Priority,
) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> {
let mime_type = String::from(mime_type);
Expand Down
6 changes: 3 additions & 3 deletions gdk4/src/auto/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl Cursor {

#[doc(alias = "gdk_cursor_new_from_texture")]
#[doc(alias = "new_from_texture")]
pub fn from_texture<P: IsA<Texture>>(
texture: &P,
pub fn from_texture(
texture: &impl IsA<Texture>,
hotspot_x: i32,
hotspot_y: i32,
fallback: Option<&Cursor>,
Expand Down Expand Up @@ -152,7 +152,7 @@ impl CursorBuilder {
self
}

pub fn texture<P: IsA<Texture>>(mut self, texture: &P) -> Self {
pub fn texture(mut self, texture: &impl IsA<Texture>) -> Self {
self.texture = Some(texture.clone().upcast());
self
}
Expand Down
8 changes: 4 additions & 4 deletions gdk4/src/auto/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub trait DisplayExt: 'static {
fn close(&self);

#[doc(alias = "gdk_display_device_is_grabbed")]
fn device_is_grabbed<P: IsA<Device>>(&self, device: &P) -> bool;
fn device_is_grabbed(&self, device: &impl IsA<Device>) -> bool;

#[doc(alias = "gdk_display_flush")]
fn flush(&self);
Expand All @@ -81,7 +81,7 @@ pub trait DisplayExt: 'static {

#[doc(alias = "gdk_display_get_monitor_at_surface")]
#[doc(alias = "get_monitor_at_surface")]
fn monitor_at_surface<P: IsA<Surface>>(&self, surface: &P) -> Option<Monitor>;
fn monitor_at_surface(&self, surface: &impl IsA<Surface>) -> Option<Monitor>;

#[doc(alias = "gdk_display_get_monitors")]
#[doc(alias = "get_monitors")]
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<O: IsA<Display>> DisplayExt for O {
}
}

fn device_is_grabbed<P: IsA<Device>>(&self, device: &P) -> bool {
fn device_is_grabbed(&self, device: &impl IsA<Device>) -> bool {
unsafe {
from_glib(ffi::gdk_display_device_is_grabbed(
self.as_ref().to_glib_none().0,
Expand Down Expand Up @@ -205,7 +205,7 @@ impl<O: IsA<Display>> DisplayExt for O {
}
}

fn monitor_at_surface<P: IsA<Surface>>(&self, surface: &P) -> Option<Monitor> {
fn monitor_at_surface(&self, surface: &impl IsA<Surface>) -> Option<Monitor> {
unsafe {
from_glib_none(ffi::gdk_display_get_monitor_at_surface(
self.as_ref().to_glib_none().0,
Expand Down
2 changes: 1 addition & 1 deletion gdk4/src/auto/display_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl DisplayManager {
}

#[doc(alias = "gdk_display_manager_set_default_display")]
pub fn set_default_display<P: IsA<Display>>(&self, display: &P) {
pub fn set_default_display(&self, display: &impl IsA<Display>) {
unsafe {
ffi::gdk_display_manager_set_default_display(
self.to_glib_none().0,
Expand Down
8 changes: 4 additions & 4 deletions gdk4/src/auto/drag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ glib::wrapper! {

impl Drag {
#[doc(alias = "gdk_drag_begin")]
pub fn begin<P: IsA<Surface>, Q: IsA<Device>, R: IsA<ContentProvider>>(
surface: &P,
device: &Q,
content: &R,
pub fn begin(
surface: &impl IsA<Surface>,
device: &impl IsA<Device>,
content: &impl IsA<ContentProvider>,
actions: DragAction,
dx: f64,
dy: f64,
Expand Down
2 changes: 1 addition & 1 deletion gdk4/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn pixbuf_get_from_surface(
}

#[doc(alias = "gdk_pixbuf_get_from_texture")]
pub fn pixbuf_get_from_texture<P: IsA<Texture>>(texture: &P) -> Option<gdk_pixbuf::Pixbuf> {
pub fn pixbuf_get_from_texture(texture: &impl IsA<Texture>) -> Option<gdk_pixbuf::Pixbuf> {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gdk_pixbuf_get_from_texture(
Expand Down
4 changes: 2 additions & 2 deletions gdk4/src/auto/gl_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub trait GLContextExt: 'static {
#[cfg(any(feature = "v4_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_4")))]
#[doc(alias = "gdk_gl_context_is_shared")]
fn is_shared<P: IsA<GLContext>>(&self, other: &P) -> bool;
fn is_shared(&self, other: &impl IsA<GLContext>) -> bool;

#[doc(alias = "gdk_gl_context_make_current")]
fn make_current(&self);
Expand Down Expand Up @@ -163,7 +163,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {

#[cfg(any(feature = "v4_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_4")))]
fn is_shared<P: IsA<GLContext>>(&self, other: &P) -> bool {
fn is_shared(&self, other: &impl IsA<GLContext>) -> bool {
unsafe {
from_glib(ffi::gdk_gl_context_is_shared(
self.as_ref().to_glib_none().0,
Expand Down
16 changes: 8 additions & 8 deletions gdk4/src/auto/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ glib::wrapper! {

impl Surface {
#[doc(alias = "gdk_surface_new_popup")]
pub fn new_popup<P: IsA<Surface>>(parent: &P, autohide: bool) -> Surface {
pub fn new_popup(parent: &impl IsA<Surface>, autohide: bool) -> Surface {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gdk_surface_new_popup(
Expand All @@ -45,7 +45,7 @@ impl Surface {
}

#[doc(alias = "gdk_surface_new_toplevel")]
pub fn new_toplevel<P: IsA<Display>>(display: &P) -> Surface {
pub fn new_toplevel(display: &impl IsA<Display>) -> Surface {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gdk_surface_new_toplevel(
Expand Down Expand Up @@ -79,11 +79,11 @@ pub trait SurfaceExt: 'static {

#[doc(alias = "gdk_surface_get_device_cursor")]
#[doc(alias = "get_device_cursor")]
fn device_cursor<P: IsA<Device>>(&self, device: &P) -> Option<Cursor>;
fn device_cursor(&self, device: &impl IsA<Device>) -> Option<Cursor>;

#[doc(alias = "gdk_surface_get_device_position")]
#[doc(alias = "get_device_position")]
fn device_position<P: IsA<Device>>(&self, device: &P) -> Option<(f64, f64, ModifierType)>;
fn device_position(&self, device: &impl IsA<Device>) -> Option<(f64, f64, ModifierType)>;

#[doc(alias = "gdk_surface_get_display")]
#[doc(alias = "get_display")]
Expand Down Expand Up @@ -125,7 +125,7 @@ pub trait SurfaceExt: 'static {
fn set_cursor(&self, cursor: Option<&Cursor>);

#[doc(alias = "gdk_surface_set_device_cursor")]
fn set_device_cursor<P: IsA<Device>>(&self, device: &P, cursor: &Cursor);
fn set_device_cursor(&self, device: &impl IsA<Device>, cursor: &Cursor);

#[doc(alias = "gdk_surface_set_input_region")]
fn set_input_region(&self, region: &cairo::Region);
Expand Down Expand Up @@ -218,7 +218,7 @@ impl<O: IsA<Surface>> SurfaceExt for O {
unsafe { from_glib_none(ffi::gdk_surface_get_cursor(self.as_ref().to_glib_none().0)) }
}

fn device_cursor<P: IsA<Device>>(&self, device: &P) -> Option<Cursor> {
fn device_cursor(&self, device: &impl IsA<Device>) -> Option<Cursor> {
unsafe {
from_glib_none(ffi::gdk_surface_get_device_cursor(
self.as_ref().to_glib_none().0,
Expand All @@ -227,7 +227,7 @@ impl<O: IsA<Surface>> SurfaceExt for O {
}
}

fn device_position<P: IsA<Device>>(&self, device: &P) -> Option<(f64, f64, ModifierType)> {
fn device_position(&self, device: &impl IsA<Device>) -> Option<(f64, f64, ModifierType)> {
unsafe {
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
Expand Down Expand Up @@ -310,7 +310,7 @@ impl<O: IsA<Surface>> SurfaceExt for O {
}
}

fn set_device_cursor<P: IsA<Device>>(&self, device: &P, cursor: &Cursor) {
fn set_device_cursor(&self, device: &impl IsA<Device>, cursor: &Cursor) {
unsafe {
ffi::gdk_surface_set_device_cursor(
self.as_ref().to_glib_none().0,
Expand Down
6 changes: 3 additions & 3 deletions gdk4/src/auto/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Texture {

#[doc(alias = "gdk_texture_new_from_file")]
#[doc(alias = "new_from_file")]
pub fn from_file<P: IsA<gio::File>>(file: &P) -> Result<Texture, glib::Error> {
pub fn from_file(file: &impl IsA<gio::File>) -> Result<Texture, glib::Error> {
assert_initialized_main_thread!();
unsafe {
let mut error = ptr::null_mut();
Expand Down Expand Up @@ -64,7 +64,7 @@ pub trait TextureExt: 'static {
fn width(&self) -> i32;

#[doc(alias = "gdk_texture_save_to_png")]
fn save_to_png<P: AsRef<std::path::Path>>(&self, filename: P) -> bool;
fn save_to_png(&self, filename: impl AsRef<std::path::Path>) -> bool;
}

impl<O: IsA<Texture>> TextureExt for O {
Expand All @@ -76,7 +76,7 @@ impl<O: IsA<Texture>> TextureExt for O {
unsafe { ffi::gdk_texture_get_width(self.as_ref().to_glib_none().0) }
}

fn save_to_png<P: AsRef<std::path::Path>>(&self, filename: P) -> bool {
fn save_to_png(&self, filename: impl AsRef<std::path::Path>) -> bool {
unsafe {
from_glib(ffi::gdk_texture_save_to_png(
self.as_ref().to_glib_none().0,
Expand Down
Loading