Skip to content

Commit

Permalink
regenerate: more Into<Option<_>> in arg position
Browse files Browse the repository at this point in the history
  • Loading branch information
fengalin committed Dec 5, 2024
1 parent 547edb0 commit 8e7fb3c
Show file tree
Hide file tree
Showing 247 changed files with 5,445 additions and 3,537 deletions.
2 changes: 1 addition & 1 deletion gdk4-macos/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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
2 changes: 1 addition & 1 deletion gdk4-macos/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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
2 changes: 1 addition & 1 deletion gdk4-win32/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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
4 changes: 2 additions & 2 deletions gdk4-win32/src/auto/win32_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ impl Win32Display {
}

#[doc(alias = "gdk_win32_display_set_cursor_theme")]
pub fn set_cursor_theme(&self, name: Option<&str>, size: i32) {
pub fn set_cursor_theme<'a>(&self, name: impl Into<Option<&'a str>>, size: i32) {
unsafe {
ffi::gdk_win32_display_set_cursor_theme(
self.to_glib_none().0,
name.to_glib_none().0,
name.into().to_glib_none().0,
size,
);
}
Expand Down
2 changes: 1 addition & 1 deletion gdk4-win32/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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
4 changes: 2 additions & 2 deletions gdk4-x11/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ pub fn x11_get_server_time(surface: &X11Surface) -> u32 {
}

#[doc(alias = "gdk_x11_set_sm_client_id")]
pub fn x11_set_sm_client_id(sm_client_id: Option<&str>) {
pub fn x11_set_sm_client_id<'a>(sm_client_id: impl Into<Option<&'a str>>) {
assert_initialized_main_thread!();
unsafe {
ffi::gdk_x11_set_sm_client_id(sm_client_id.to_glib_none().0);
ffi::gdk_x11_set_sm_client_id(sm_client_id.into().to_glib_none().0);
}
}
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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
6 changes: 4 additions & 2 deletions gdk4-x11/src/auto/x11_device_manager_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ impl X11DeviceManagerXI2Builder {
}
}

pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
pub fn display<'a, P: IsA<gdk::Display>>(self, display: impl Into<Option<&'a P>>) -> Self {
Self {
builder: self.builder.property("display", display.clone().upcast()),
builder: self
.builder
.property("display", display.into().as_ref().map(|p| p.as_ref())),
}
}

Expand Down
16 changes: 9 additions & 7 deletions gdk4-x11/src/auto/x11_device_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ impl X11DeviceXI2Builder {
}
}

pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
pub fn display<'a, P: IsA<gdk::Display>>(self, display: impl Into<Option<&'a P>>) -> Self {
Self {
builder: self.builder.property("display", display.clone().upcast()),
builder: self
.builder
.property("display", display.into().as_ref().map(|p| p.as_ref())),
}
}

Expand All @@ -63,7 +65,7 @@ impl X11DeviceXI2Builder {
}
}

pub fn name(self, name: impl Into<glib::GString>) -> Self {
pub fn name<'a>(self, name: impl Into<Option<&'a str>>) -> Self {
Self {
builder: self.builder.property("name", name.into()),
}
Expand All @@ -75,15 +77,15 @@ impl X11DeviceXI2Builder {
}
}

pub fn product_id(self, product_id: impl Into<glib::GString>) -> Self {
pub fn product_id<'a>(self, product_id: impl Into<Option<&'a str>>) -> Self {
Self {
builder: self.builder.property("product-id", product_id.into()),
}
}

pub fn seat(self, seat: &gdk::Seat) -> Self {
pub fn seat<'a>(self, seat: impl Into<Option<&'a gdk::Seat>>) -> Self {
Self {
builder: self.builder.property("seat", seat.clone()),
builder: self.builder.property("seat", seat.into()),
}
}

Expand All @@ -93,7 +95,7 @@ impl X11DeviceXI2Builder {
}
}

pub fn vendor_id(self, vendor_id: impl Into<glib::GString>) -> Self {
pub fn vendor_id<'a>(self, vendor_id: impl Into<Option<&'a str>>) -> Self {
Self {
builder: self.builder.property("vendor-id", vendor_id.into()),
}
Expand Down
12 changes: 8 additions & 4 deletions gdk4-x11/src/auto/x11_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ impl X11Display {
#[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")]
#[allow(deprecated)]
#[doc(alias = "gdk_x11_display_set_cursor_theme")]
pub fn set_cursor_theme(&self, theme: Option<&str>, size: i32) {
pub fn set_cursor_theme<'a>(&self, theme: impl Into<Option<&'a str>>, size: i32) {
unsafe {
ffi::gdk_x11_display_set_cursor_theme(
self.to_glib_none().0,
theme.to_glib_none().0,
theme.into().to_glib_none().0,
size,
);
}
Expand Down Expand Up @@ -222,8 +222,12 @@ impl X11Display {
}

#[doc(alias = "gdk_x11_display_open")]
pub fn open(display_name: Option<&str>) -> Option<gdk::Display> {
pub fn open<'a>(display_name: impl Into<Option<&'a str>>) -> Option<gdk::Display> {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::gdk_x11_display_open(display_name.to_glib_none().0)) }
unsafe {
from_glib_full(ffi::gdk_x11_display_open(
display_name.into().to_glib_none().0,
))
}
}
}
4 changes: 2 additions & 2 deletions gdk4-x11/src/auto/x11_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ impl X11Surface {
}

#[doc(alias = "gdk_x11_surface_set_utf8_property")]
pub fn set_utf8_property(&self, name: &str, value: Option<&str>) {
pub fn set_utf8_property<'a>(&self, name: &str, value: impl Into<Option<&'a str>>) {
unsafe {
ffi::gdk_x11_surface_set_utf8_property(
self.to_glib_none().0,
name.to_glib_none().0,
value.to_glib_none().0,
value.into().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 @ ae29aefbe96a)
Generated by gir (https://github.com/gtk-rs/gir @ 24f0d6639caa)
from gir-files (https://github.com/gtk-rs/gir-files @ c05f5cc23cb7)
8 changes: 4 additions & 4 deletions gdk4/src/auto/app_launch_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ pub trait GdkAppLaunchContextExt: IsA<AppLaunchContext> + 'static {
}

#[doc(alias = "gdk_app_launch_context_set_icon")]
fn set_icon(&self, icon: Option<&impl IsA<gio::Icon>>) {
fn set_icon<'a, P: IsA<gio::Icon>>(&self, icon: impl Into<Option<&'a P>>) {
unsafe {
ffi::gdk_app_launch_context_set_icon(
self.as_ref().to_glib_none().0,
icon.map(|p| p.as_ref()).to_glib_none().0,
icon.into().as_ref().map(|p| p.as_ref()).to_glib_none().0,
);
}
}

#[doc(alias = "gdk_app_launch_context_set_icon_name")]
fn set_icon_name(&self, icon_name: Option<&str>) {
fn set_icon_name<'a>(&self, icon_name: impl Into<Option<&'a str>>) {
unsafe {
ffi::gdk_app_launch_context_set_icon_name(
self.as_ref().to_glib_none().0,
icon_name.to_glib_none().0,
icon_name.into().to_glib_none().0,
);
}
}
Expand Down
Loading

0 comments on commit 8e7fb3c

Please sign in to comment.