Skip to content

Commit

Permalink
Merge pull request #531 from sdroege/0.15-backports
Browse files Browse the repository at this point in the history
0.15 backports
  • Loading branch information
sdroege committed Feb 6, 2022
2 parents ec496cb + aad4ad5 commit 9a5fef9
Show file tree
Hide file tree
Showing 31 changed files with 503 additions and 32 deletions.
2 changes: 1 addition & 1 deletion gdk-pixbuf/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 @ 78e3d3c22343)
from gir-files (https://github.com/gtk-rs/gir-files @ 3ff4d3275258)
from gir-files (https://github.com/gtk-rs/gir-files @ 86743c80d34b)
2 changes: 1 addition & 1 deletion gdk-pixbuf/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 @ 78e3d3c22343)
from gir-files (https://github.com/gtk-rs/gir-files @ 3ff4d3275258)
from gir-files (https://github.com/gtk-rs/gir-files @ 86743c80d34b)
8 changes: 7 additions & 1 deletion gio/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ generate = [
"Gio.BytesIcon",
"Gio.ConverterFlags",
"Gio.ConverterResult",
"Gio.CredentialsType",
"Gio.DataStreamByteOrder",
"Gio.DataStreamNewlineType",
"Gio.DBusActionGroup",
Expand Down Expand Up @@ -376,6 +375,13 @@ status = "generate"
name = "set_unix_user"
cfg_condition = "unix"

[[object]]
name = "Gio.CredentialsType"
status = "generate"
[[object.member]]
name = "win32_pid"
version = "2.72"

[[object]]
name = "Gio.DataInputStream"
manual_traits = ["DataInputStreamExtManual"]
Expand Down
9 changes: 9 additions & 0 deletions gio/src/auto/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

use std::ffi::CStr;

#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
#[doc(alias = "G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME")]
pub static DEBUG_CONTROLLER_EXTENSION_POINT_NAME: once_cell::sync::Lazy<&'static str> =
once_cell::sync::Lazy::new(|| unsafe {
CStr::from_ptr(ffi::G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME)
.to_str()
.unwrap()
});
#[cfg(any(feature = "v2_58", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_58")))]
#[doc(alias = "G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE")]
Expand Down
10 changes: 10 additions & 0 deletions gio/src/auto/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ pub enum CredentialsType {
NetbsdUnpcbid,
#[doc(alias = "G_CREDENTIALS_TYPE_APPLE_XUCRED")]
AppleXucred,
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
#[doc(alias = "G_CREDENTIALS_TYPE_WIN32_PID")]
Win32Pid,
#[doc(hidden)]
__Unknown(i32),
}
Expand All @@ -230,6 +234,8 @@ impl fmt::Display for CredentialsType {
Self::SolarisUcred => "SolarisUcred",
Self::NetbsdUnpcbid => "NetbsdUnpcbid",
Self::AppleXucred => "AppleXucred",
#[cfg(any(feature = "v2_72", feature = "dox"))]
Self::Win32Pid => "Win32Pid",
_ => "Unknown",
}
)
Expand All @@ -249,6 +255,8 @@ impl IntoGlib for CredentialsType {
Self::SolarisUcred => ffi::G_CREDENTIALS_TYPE_SOLARIS_UCRED,
Self::NetbsdUnpcbid => ffi::G_CREDENTIALS_TYPE_NETBSD_UNPCBID,
Self::AppleXucred => ffi::G_CREDENTIALS_TYPE_APPLE_XUCRED,
#[cfg(any(feature = "v2_72", feature = "dox"))]
Self::Win32Pid => ffi::G_CREDENTIALS_TYPE_WIN32_PID,
Self::__Unknown(value) => value,
}
}
Expand All @@ -265,6 +273,8 @@ impl FromGlib<ffi::GCredentialsType> for CredentialsType {
ffi::G_CREDENTIALS_TYPE_SOLARIS_UCRED => Self::SolarisUcred,
ffi::G_CREDENTIALS_TYPE_NETBSD_UNPCBID => Self::NetbsdUnpcbid,
ffi::G_CREDENTIALS_TYPE_APPLE_XUCRED => Self::AppleXucred,
#[cfg(any(feature = "v2_72", feature = "dox"))]
ffi::G_CREDENTIALS_TYPE_WIN32_PID => Self::Win32Pid,
value => Self::__Unknown(value),
}
}
Expand Down
4 changes: 2 additions & 2 deletions gio/src/auto/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ pub trait FileExt: 'static {

#[doc(alias = "g_file_resolve_relative_path")]
#[must_use]
fn resolve_relative_path(&self, relative_path: impl AsRef<std::path::Path>) -> Option<File>;
fn resolve_relative_path(&self, relative_path: impl AsRef<std::path::Path>) -> File;

//#[doc(alias = "g_file_set_attribute")]
//fn set_attribute(&self, attribute: &str, type_: FileAttributeType, value_p: /*Unimplemented*/Option<Fundamental: Pointer>, flags: FileQueryInfoFlags, cancellable: Option<&impl IsA<Cancellable>>) -> Result<(), glib::Error>;
Expand Down Expand Up @@ -2921,7 +2921,7 @@ impl<O: IsA<File>> FileExt for O {
))
}

fn resolve_relative_path(&self, relative_path: impl AsRef<std::path::Path>) -> Option<File> {
fn resolve_relative_path(&self, relative_path: impl AsRef<std::path::Path>) -> File {
unsafe {
from_glib_full(ffi::g_file_resolve_relative_path(
self.as_ref().to_glib_none().0,
Expand Down
3 changes: 3 additions & 0 deletions gio/src/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ pub use self::flags::TlsPasswordFlags;
pub mod functions;

mod constants;
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub use self::constants::DEBUG_CONTROLLER_EXTENSION_POINT_NAME;
#[cfg(any(feature = "v2_58", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_58")))]
pub use self::constants::DRIVE_IDENTIFIER_KIND_UNIX_DEVICE;
Expand Down
2 changes: 1 addition & 1 deletion gio/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 @ 78e3d3c22343)
from gir-files (https://github.com/gtk-rs/gir-files @ 3ff4d3275258)
from gir-files (https://github.com/gtk-rs/gir-files @ 86743c80d34b)
2 changes: 1 addition & 1 deletion gio/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ macro_rules! task_impl {
Ok(v) => unsafe {
ffi::g_task_return_value(
self.to_glib_none().0,
v.to_value().to_glib_full() as *mut _,
v.to_value().to_glib_none().0 as *mut _,
)
},
#[cfg(not(feature = "v2_64"))]
Expand Down
95 changes: 95 additions & 0 deletions gio/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub const G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED: GCredentialsType = 3;
pub const G_CREDENTIALS_TYPE_SOLARIS_UCRED: GCredentialsType = 4;
pub const G_CREDENTIALS_TYPE_NETBSD_UNPCBID: GCredentialsType = 5;
pub const G_CREDENTIALS_TYPE_APPLE_XUCRED: GCredentialsType = 6;
pub const G_CREDENTIALS_TYPE_WIN32_PID: GCredentialsType = 7;

pub type GDBusError = c_int;
pub const G_DBUS_ERROR_FAILED: GDBusError = 0;
Expand Down Expand Up @@ -385,6 +386,8 @@ pub const G_ZLIB_COMPRESSOR_FORMAT_RAW: GZlibCompressorFormat = 2;
// Constants
pub const G_DBUS_METHOD_INVOCATION_HANDLED: gboolean = glib::GTRUE;
pub const G_DBUS_METHOD_INVOCATION_UNHANDLED: gboolean = glib::GFALSE;
pub const G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME: *const c_char =
b"gio-debug-controller\0" as *const u8 as *const c_char;
pub const G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME: *const c_char =
b"gio-desktop-app-info-lookup\0" as *const u8 as *const c_char;
pub const G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE: *const c_char =
Expand Down Expand Up @@ -2232,6 +2235,39 @@ impl ::std::fmt::Debug for GDatagramBasedInterface {
}
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GDebugControllerDBusClass {
pub parent_class: gobject::GObjectClass,
pub authorize: Option<
unsafe extern "C" fn(*mut GDebugControllerDBus, *mut GDBusMethodInvocation) -> gboolean,
>,
pub padding: [gpointer; 12],
}

impl ::std::fmt::Debug for GDebugControllerDBusClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GDebugControllerDBusClass @ {:p}", self))
.field("parent_class", &self.parent_class)
.field("authorize", &self.authorize)
.field("padding", &self.padding)
.finish()
}
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GDebugControllerInterface {
pub g_iface: gobject::GTypeInterface,
}

impl ::std::fmt::Debug for GDebugControllerInterface {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GDebugControllerInterface @ {:p}", self))
.finish()
}
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GDesktopAppInfoClass {
Expand Down Expand Up @@ -7554,6 +7590,20 @@ impl ::std::fmt::Debug for GDataOutputStream {
}
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct GDebugControllerDBus {
pub parent_instance: gobject::GObject,
}

impl ::std::fmt::Debug for GDebugControllerDBus {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GDebugControllerDBus @ {:p}", self))
.field("parent_instance", &self.parent_instance)
.finish()
}
}

#[repr(C)]
pub struct GDesktopAppInfo {
_data: [u8; 0],
Expand Down Expand Up @@ -8849,6 +8899,18 @@ impl ::std::fmt::Debug for GDatagramBased {
}
}

#[repr(C)]
pub struct GDebugController {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for GDebugController {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "GDebugController @ {:p}", self)
}
}

#[repr(C)]
pub struct GDesktopAppInfoLookup {
_data: [u8; 0],
Expand Down Expand Up @@ -11391,6 +11453,20 @@ extern "C" {
order: GDataStreamByteOrder,
);

//=========================================================================
// GDebugControllerDBus
//=========================================================================
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub fn g_debug_controller_dbus_get_type() -> GType;
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub fn g_debug_controller_dbus_new(
connection: *mut GDBusConnection,
cancellable: *mut GCancellable,
error: *mut *mut glib::GError,
) -> *mut GDebugControllerDBus;

//=========================================================================
// GDesktopAppInfo
//=========================================================================
Expand Down Expand Up @@ -15031,6 +15107,25 @@ extern "C" {
error: *mut *mut glib::GError,
) -> c_int;

//=========================================================================
// GDebugController
//=========================================================================
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub fn g_debug_controller_get_type() -> GType;
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub fn g_debug_controller_dup_default() -> *mut GDebugController;
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub fn g_debug_controller_get_debug_enabled(self_: *mut GDebugController) -> gboolean;
#[cfg(any(feature = "v2_72", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
pub fn g_debug_controller_set_debug_enabled(
self_: *mut GDebugController,
debug_enabled: gboolean,
);

//=========================================================================
// GDesktopAppInfoLookup
//=========================================================================
Expand Down
26 changes: 26 additions & 0 deletions gio/sys/tests/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,27 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[
alignment: align_of::<GDatagramBasedInterface>(),
},
),
(
"GDebugControllerDBus",
Layout {
size: size_of::<GDebugControllerDBus>(),
alignment: align_of::<GDebugControllerDBus>(),
},
),
(
"GDebugControllerDBusClass",
Layout {
size: size_of::<GDebugControllerDBusClass>(),
alignment: align_of::<GDebugControllerDBusClass>(),
},
),
(
"GDebugControllerInterface",
Layout {
size: size_of::<GDebugControllerInterface>(),
alignment: align_of::<GDebugControllerInterface>(),
},
),
(
"GDesktopAppInfoClass",
Layout {
Expand Down Expand Up @@ -2290,6 +2311,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
("(gint) G_CREDENTIALS_TYPE_NETBSD_UNPCBID", "5"),
("(gint) G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED", "3"),
("(gint) G_CREDENTIALS_TYPE_SOLARIS_UCRED", "4"),
("(gint) G_CREDENTIALS_TYPE_WIN32_PID", "7"),
("(gint) G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN", "0"),
("(gint) G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN", "2"),
("(gint) G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN", "1"),
Expand Down Expand Up @@ -2439,6 +2461,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
"1",
),
("(guint) G_DBUS_SUBTREE_FLAGS_NONE", "0"),
(
"G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME",
"gio-debug-controller",
),
(
"G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME",
"gio-desktop-app-info-lookup",
Expand Down
2 changes: 2 additions & 0 deletions gio/sys/tests/constant.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int main() {
PRINT_CONSTANT((gint) G_CREDENTIALS_TYPE_NETBSD_UNPCBID);
PRINT_CONSTANT((gint) G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED);
PRINT_CONSTANT((gint) G_CREDENTIALS_TYPE_SOLARIS_UCRED);
PRINT_CONSTANT((gint) G_CREDENTIALS_TYPE_WIN32_PID);
PRINT_CONSTANT((gint) G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN);
PRINT_CONSTANT((gint) G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN);
PRINT_CONSTANT((gint) G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
Expand Down Expand Up @@ -185,6 +186,7 @@ int main() {
PRINT_CONSTANT((guint) G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE);
PRINT_CONSTANT((guint) G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES);
PRINT_CONSTANT((guint) G_DBUS_SUBTREE_FLAGS_NONE);
PRINT_CONSTANT(G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME);
PRINT_CONSTANT(G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
PRINT_CONSTANT(G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE);
PRINT_CONSTANT((guint) G_DRIVE_START_NONE);
Expand Down
3 changes: 3 additions & 0 deletions gio/sys/tests/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ int main() {
printf("%s;%zu;%zu\n", "GDataStreamByteOrder", sizeof(GDataStreamByteOrder), alignof(GDataStreamByteOrder));
printf("%s;%zu;%zu\n", "GDataStreamNewlineType", sizeof(GDataStreamNewlineType), alignof(GDataStreamNewlineType));
printf("%s;%zu;%zu\n", "GDatagramBasedInterface", sizeof(GDatagramBasedInterface), alignof(GDatagramBasedInterface));
printf("%s;%zu;%zu\n", "GDebugControllerDBus", sizeof(GDebugControllerDBus), alignof(GDebugControllerDBus));
printf("%s;%zu;%zu\n", "GDebugControllerDBusClass", sizeof(GDebugControllerDBusClass), alignof(GDebugControllerDBusClass));
printf("%s;%zu;%zu\n", "GDebugControllerInterface", sizeof(GDebugControllerInterface), alignof(GDebugControllerInterface));
printf("%s;%zu;%zu\n", "GDesktopAppInfoClass", sizeof(GDesktopAppInfoClass), alignof(GDesktopAppInfoClass));
printf("%s;%zu;%zu\n", "GDesktopAppInfoLookupIface", sizeof(GDesktopAppInfoLookupIface), alignof(GDesktopAppInfoLookupIface));
printf("%s;%zu;%zu\n", "GDriveIface", sizeof(GDriveIface), alignof(GDriveIface));
Expand Down
2 changes: 1 addition & 1 deletion gio/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 @ 78e3d3c22343)
from gir-files (https://github.com/gtk-rs/gir-files @ 3ff4d3275258)
from gir-files (https://github.com/gtk-rs/gir-files @ 86743c80d34b)
2 changes: 1 addition & 1 deletion gir-files
Submodule gir-files updated 5 files
+32 −1 GLib-2.0.gir
+500 −0 GObject-2.0.gir
+10 −4 Gdk-4.0.gir
+252 −23 Gio-2.0.gir
+7 −7 Gtk-4.0.gir
4 changes: 4 additions & 0 deletions glib/gobject-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dox = []
v2_66 = ["v2_62"]
v2_68 = ["v2_66"]
v2_70 = ["v2_68"]
v2_72 = ["v2_70"]

[lib]
name = "gobject_sys"
Expand Down Expand Up @@ -60,3 +61,6 @@ version = "2.68"

[package.metadata.system-deps.gobject_2_0.v2_70]
version = "2.70"

[package.metadata.system-deps.gobject_2_0.v2_72]
version = "2.72"

0 comments on commit 9a5fef9

Please sign in to comment.