diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 85fd5cd41d53..1c02c90b3cb1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,8 +22,8 @@ jobs: conf: - { name: "cairo", features: "png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface", nightly: "--features 'png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface'", test_sys: true } - { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true } - - { name: "gio", features: "v2_78", nightly: "--all-features", test_sys: true } - - { name: "glib", features: "v2_78", nightly: "--all-features", test_sys: true } + - { name: "gio", features: "v2_80", nightly: "--all-features", test_sys: true } + - { name: "glib", features: "v2_80", nightly: "--all-features", test_sys: false } - { name: "graphene", features: "v1_12", nightly: "", test_sys: true } - { name: "pango", features: "v1_50", nightly: "--all-features", test_sys: true } - { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2a60bcebc89b..d6c91894aa22 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: env: # git revision of gvsbuild we use for to build GLib and the other dependencies - gvsbuildref: 1b3c28a3aa2312e7796f5f91b0a897a7a38b9292 + gvsbuildref: de70bfe8f540249aafbf8247ac6886019262917f # bump this number if you want to force a rebuild of gvsbuild with the same revision gvsbuildupdate: 1 @@ -80,8 +80,8 @@ jobs: conf: - { name: "cairo", test: true, args: "--features png,pdf,svg,ps,use_glib,v1_16,freetype,script,win32-surface" } - { name: "gdk-pixbuf", test: true, args: "--features v2_42" } - - { name: "gio", test: true, args: "--features v2_74" } - - { name: "glib", test: true, args: "--features v2_74" } + - { name: "gio", test: true, args: "--features v2_80" } + - { name: "glib", test: true, args: "--features v2_80" } - { name: "glib-build-tools", test: false, args: "" } - { name: "graphene", test: false, args: "" } - { name: "pango", test: true, args: "--features v1_50" } diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gdk-pixbuf/sys/src/lib.rs b/gdk-pixbuf/sys/src/lib.rs index af95db31103f..87eb0bfc5005 100644 --- a/gdk-pixbuf/sys/src/lib.rs +++ b/gdk-pixbuf/sys/src/lib.rs @@ -288,7 +288,7 @@ pub struct _GdkPixbufSimpleAnimClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GdkPixbufSimpleAnimClass = *mut _GdkPixbufSimpleAnimClass; +pub type GdkPixbufSimpleAnimClass = _GdkPixbufSimpleAnimClass; // Classes #[repr(C)] diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gio/Cargo.toml b/gio/Cargo.toml index 546053ac4d09..9fbe0df329eb 100644 --- a/gio/Cargo.toml +++ b/gio/Cargo.toml @@ -31,6 +31,7 @@ v2_72 = ["v2_70", "ffi/v2_72", "glib/v2_72"] v2_74 = ["v2_72", "ffi/v2_74", "glib/v2_74"] v2_76 = ["v2_74", "ffi/v2_76", "glib/v2_76"] v2_78 = ["v2_76", "ffi/v2_78", "glib/v2_78"] +v2_80 = ["v2_78", "ffi/v2_80", "glib/v2_80"] [package.metadata.docs.rs] all-features = true diff --git a/gio/Gir.toml b/gio/Gir.toml index 3a610fd062f6..a79f38da404c 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -3,6 +3,7 @@ girs_directories = ["../gir-files"] library = "Gio" version = "2.0" min_cfg_version = "2.56" +use_gi_docgen = true target_path = "." work_mode = "normal" single_version_file = true @@ -60,7 +61,6 @@ generate = [ "Gio.FileAttributeInfoFlags", "Gio.FileAttributeStatus", "Gio.FileAttributeType", - "Gio.FileCopyFlags", "Gio.FileCreateFlags", "Gio.FileIcon", "Gio.FileInputStream", @@ -98,10 +98,8 @@ generate = [ "Gio.Proxy", "Gio.ProxyResolver", "Gio.RemoteActionGroup", - "Gio.Resolver", "Gio.ResolverError", "Gio.ResolverNameLookupFlags", - "Gio.ResolverRecordType", "Gio.ResourceError", "Gio.ResourceLookupFlags", "Gio.Seekable", @@ -799,6 +797,13 @@ status = "generate" # Better API with `IntoIter` ignore = true +[[object]] +name = "Gio.FileCopyFlags" +status = "generate" + [[object.member]] + name = "target_default_modified_time" + version = "2.80" + [[object]] name = "Gio.FileDescriptorBased" status = "manual" @@ -910,6 +915,9 @@ status = "generate" [[object.member]] name = "no_such_device" version = "2.72" + [[object.member]] + name = "destination_unset" + version = "2.80" [[object]] name = "Gio.IOStream" @@ -1129,6 +1137,22 @@ name = "Gio.ProxyAddress" status = "generate" concurrency = "send+sync" +[[object]] +name = "Gio.Resolver" +status = "generate" + [[object.function]] + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + name = "records_from_res_query" + ignore = true + +[[object]] +name = "Gio.ResolverRecordType" +status = "generate" + [[object.function]] + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + name = "to_rrtype" + ignore = true + [[object]] name = "Gio.Resource" status = "generate" diff --git a/gio/src/auto/application_command_line.rs b/gio/src/auto/application_command_line.rs index f4cf991fdc88..5fe5e53aa78b 100644 --- a/gio/src/auto/application_command_line.rs +++ b/gio/src/auto/application_command_line.rs @@ -41,6 +41,15 @@ pub trait ApplicationCommandLineExt: } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_application_command_line_done")] + fn done(&self) { + unsafe { + ffi::g_application_command_line_done(self.as_ref().to_glib_none().0); + } + } + #[doc(alias = "g_application_command_line_get_arguments")] #[doc(alias = "get_arguments")] fn arguments(&self) -> Vec { @@ -138,11 +147,35 @@ pub trait ApplicationCommandLineExt: // unsafe { TODO: call ffi:g_application_command_line_print() } //} + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_application_command_line_print_literal")] + fn print_literal(&self, message: &str) { + unsafe { + ffi::g_application_command_line_print_literal( + self.as_ref().to_glib_none().0, + message.to_glib_none().0, + ); + } + } + //#[doc(alias = "g_application_command_line_printerr")] //fn printerr(&self, format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:g_application_command_line_printerr() } //} + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_application_command_line_printerr_literal")] + fn printerr_literal(&self, message: &str) { + unsafe { + ffi::g_application_command_line_printerr_literal( + self.as_ref().to_glib_none().0, + message.to_glib_none().0, + ); + } + } + #[doc(alias = "g_application_command_line_set_exit_status")] fn set_exit_status(&self, exit_status: i32) { unsafe { diff --git a/gio/src/auto/dbus_message.rs b/gio/src/auto/dbus_message.rs index 68c207bcce07..85eec9c505e5 100644 --- a/gio/src/auto/dbus_message.rs +++ b/gio/src/auto/dbus_message.rs @@ -101,6 +101,14 @@ impl DBusMessage { unsafe { from_glib_none(ffi::g_dbus_message_get_arg0(self.to_glib_none().0)) } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_dbus_message_get_arg0_path")] + #[doc(alias = "get_arg0_path")] + pub fn arg0_path(&self) -> Option { + unsafe { from_glib_none(ffi::g_dbus_message_get_arg0_path(self.to_glib_none().0)) } + } + #[doc(alias = "g_dbus_message_get_body")] #[doc(alias = "get_body")] pub fn body(&self) -> Option { diff --git a/gio/src/auto/enums.rs b/gio/src/auto/enums.rs index a94d71d6ef12..2ad826ab27f9 100644 --- a/gio/src/auto/enums.rs +++ b/gio/src/auto/enums.rs @@ -1606,6 +1606,10 @@ pub enum IOErrorEnum { #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))] #[doc(alias = "G_IO_ERROR_NO_SUCH_DEVICE")] NoSuchDevice, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_IO_ERROR_DESTINATION_UNSET")] + DestinationUnset, #[doc(hidden)] __Unknown(i32), } @@ -1665,6 +1669,8 @@ impl IntoGlib for IOErrorEnum { Self::MessageTooLarge => ffi::G_IO_ERROR_MESSAGE_TOO_LARGE, #[cfg(feature = "v2_72")] Self::NoSuchDevice => ffi::G_IO_ERROR_NO_SUCH_DEVICE, + #[cfg(feature = "v2_80")] + Self::DestinationUnset => ffi::G_IO_ERROR_DESTINATION_UNSET, Self::__Unknown(value) => value, } } @@ -1723,6 +1729,8 @@ impl FromGlib for IOErrorEnum { ffi::G_IO_ERROR_MESSAGE_TOO_LARGE => Self::MessageTooLarge, #[cfg(feature = "v2_72")] ffi::G_IO_ERROR_NO_SUCH_DEVICE => Self::NoSuchDevice, + #[cfg(feature = "v2_80")] + ffi::G_IO_ERROR_DESTINATION_UNSET => Self::DestinationUnset, value => Self::__Unknown(value), } } diff --git a/gio/src/auto/flags.rs b/gio/src/auto/flags.rs index d965b678a945..2f93bfe4356d 100644 --- a/gio/src/auto/flags.rs +++ b/gio/src/auto/flags.rs @@ -1590,6 +1590,10 @@ bitflags! { const NO_FALLBACK_FOR_MOVE = ffi::G_FILE_COPY_NO_FALLBACK_FOR_MOVE as _; #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_PERMS")] const TARGET_DEFAULT_PERMS = ffi::G_FILE_COPY_TARGET_DEFAULT_PERMS as _; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME")] + const TARGET_DEFAULT_MODIFIED_TIME = ffi::G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME as _; } } diff --git a/gio/src/auto/subprocess_launcher.rs b/gio/src/auto/subprocess_launcher.rs index 8de84842753a..5e5441bd3a40 100644 --- a/gio/src/auto/subprocess_launcher.rs +++ b/gio/src/auto/subprocess_launcher.rs @@ -108,11 +108,11 @@ impl SubprocessLauncher { #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] #[doc(alias = "g_subprocess_launcher_set_stdin_file_path")] - pub fn set_stdin_file_path(&self, path: &str) { + pub fn set_stdin_file_path(&self, path: Option>) { unsafe { ffi::g_subprocess_launcher_set_stdin_file_path( self.to_glib_none().0, - path.to_glib_none().0, + path.as_ref().map(|p| p.as_ref()).to_glib_none().0, ); } } diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gio/sys/Cargo.toml b/gio/sys/Cargo.toml index 3cb59560403b..be00c71f046e 100644 --- a/gio/sys/Cargo.toml +++ b/gio/sys/Cargo.toml @@ -32,6 +32,7 @@ v2_72 = ["v2_70"] v2_74 = ["v2_72"] v2_76 = ["v2_74"] v2_78 = ["v2_76"] +v2_80 = ["v2_78"] [lib] name = "gio_sys" @@ -86,6 +87,9 @@ version = "2.76" [package.metadata.system-deps.gio_2_0.v2_78] version = "2.77" +[package.metadata.system-deps.gio_2_0.v2_80] +version = "2.79" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] diff --git a/gio/sys/Gir.toml b/gio/sys/Gir.toml index a729f47271f6..9210453b4f99 100644 --- a/gio/sys/Gir.toml +++ b/gio/sys/Gir.toml @@ -11,6 +11,10 @@ external_libraries = [ "GObject", ] +ignore = [ + "Gio.ThreadedResolverClass" +] + [[object]] name = "Gio.SocketFamily" status = "manual" @@ -44,3 +48,17 @@ status = "generate" [[object.function]] name = "close" cfg_condition = "unix" + +[[object]] +name = "Gio.Resolver" +status = "generate" + [[object.function]] + name = "records_from_res_query" + ignore = true + +[[object]] +name = "Gio.ResolverRecordType" +status = "generate" + [[object.function]] + name = "to_rrtype" + ignore = true diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index 8b88ffa31501..ddb0f91fc8de 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -235,6 +235,7 @@ pub const G_IO_ERROR_CONNECTION_CLOSED: GIOErrorEnum = 44; pub const G_IO_ERROR_NOT_CONNECTED: GIOErrorEnum = 45; pub const G_IO_ERROR_MESSAGE_TOO_LARGE: GIOErrorEnum = 46; pub const G_IO_ERROR_NO_SUCH_DEVICE: GIOErrorEnum = 47; +pub const G_IO_ERROR_DESTINATION_UNSET: GIOErrorEnum = 48; pub type GIOModuleScopeFlags = c_int; pub const G_IO_MODULE_SCOPE_NONE: GIOModuleScopeFlags = 0; @@ -645,6 +646,7 @@ pub const G_FILE_COPY_NOFOLLOW_SYMLINKS: GFileCopyFlags = 4; pub const G_FILE_COPY_ALL_METADATA: GFileCopyFlags = 8; pub const G_FILE_COPY_NO_FALLBACK_FOR_MOVE: GFileCopyFlags = 16; pub const G_FILE_COPY_TARGET_DEFAULT_PERMS: GFileCopyFlags = 32; +pub const G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME: GFileCopyFlags = 64; pub type GFileCreateFlags = c_uint; pub const G_FILE_CREATE_NONE: GFileCreateFlags = 0; @@ -1171,7 +1173,7 @@ pub struct _GAppLaunchContextPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GAppLaunchContextPrivate = *mut _GAppLaunchContextPrivate; +pub type GAppLaunchContextPrivate = _GAppLaunchContextPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1238,7 +1240,8 @@ pub struct GApplicationCommandLineClass { pub print_literal: Option, pub printerr_literal: Option, pub get_stdin: Option *mut GInputStream>, - pub padding: [gpointer; 11], + pub done: Option, + pub padding: [gpointer; 10], } impl ::std::fmt::Debug for GApplicationCommandLineClass { @@ -1247,6 +1250,7 @@ impl ::std::fmt::Debug for GApplicationCommandLineClass { .field("print_literal", &self.print_literal) .field("printerr_literal", &self.printerr_literal) .field("get_stdin", &self.get_stdin) + .field("done", &self.done) .finish() } } @@ -1257,7 +1261,7 @@ pub struct _GApplicationCommandLinePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GApplicationCommandLinePrivate = *mut _GApplicationCommandLinePrivate; +pub type GApplicationCommandLinePrivate = _GApplicationCommandLinePrivate; #[repr(C)] pub struct _GApplicationPrivate { @@ -1265,7 +1269,7 @@ pub struct _GApplicationPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GApplicationPrivate = *mut _GApplicationPrivate; +pub type GApplicationPrivate = _GApplicationPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1377,7 +1381,7 @@ pub struct _GBufferedInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GBufferedInputStreamPrivate = *mut _GBufferedInputStreamPrivate; +pub type GBufferedInputStreamPrivate = _GBufferedInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1403,7 +1407,7 @@ pub struct _GBufferedOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GBufferedOutputStreamPrivate = *mut _GBufferedOutputStreamPrivate; +pub type GBufferedOutputStreamPrivate = _GBufferedOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1437,7 +1441,7 @@ pub struct _GCancellablePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GCancellablePrivate = *mut _GCancellablePrivate; +pub type GCancellablePrivate = _GCancellablePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1513,7 +1517,7 @@ pub struct _GConverterInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GConverterInputStreamPrivate = *mut _GConverterInputStreamPrivate; +pub type GConverterInputStreamPrivate = _GConverterInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1545,7 +1549,7 @@ pub struct _GConverterOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GConverterOutputStreamPrivate = *mut _GConverterOutputStreamPrivate; +pub type GConverterOutputStreamPrivate = _GConverterOutputStreamPrivate; #[repr(C)] pub struct _GCredentialsClass { @@ -1553,7 +1557,7 @@ pub struct _GCredentialsClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GCredentialsClass = *mut _GCredentialsClass; +pub type GCredentialsClass = _GCredentialsClass; #[derive(Copy, Clone)] #[repr(C)] @@ -1694,7 +1698,7 @@ pub struct _GDBusInterfaceSkeletonPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusInterfaceSkeletonPrivate = *mut _GDBusInterfaceSkeletonPrivate; +pub type GDBusInterfaceSkeletonPrivate = _GDBusInterfaceSkeletonPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1829,7 +1833,7 @@ pub struct _GDBusObjectManagerClientPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectManagerClientPrivate = *mut _GDBusObjectManagerClientPrivate; +pub type GDBusObjectManagerClientPrivate = _GDBusObjectManagerClientPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1893,7 +1897,7 @@ pub struct _GDBusObjectManagerServerPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectManagerServerPrivate = *mut _GDBusObjectManagerServerPrivate; +pub type GDBusObjectManagerServerPrivate = _GDBusObjectManagerServerPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1916,7 +1920,7 @@ pub struct _GDBusObjectProxyPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectProxyPrivate = *mut _GDBusObjectProxyPrivate; +pub type GDBusObjectProxyPrivate = _GDBusObjectProxyPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1947,7 +1951,7 @@ pub struct _GDBusObjectSkeletonPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectSkeletonPrivate = *mut _GDBusObjectSkeletonPrivate; +pub type GDBusObjectSkeletonPrivate = _GDBusObjectSkeletonPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1998,7 +2002,7 @@ pub struct _GDBusProxyPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusProxyPrivate = *mut _GDBusProxyPrivate; +pub type GDBusProxyPrivate = _GDBusProxyPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2069,7 +2073,7 @@ pub struct _GDataInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDataInputStreamPrivate = *mut _GDataInputStreamPrivate; +pub type GDataInputStreamPrivate = _GDataInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2101,7 +2105,7 @@ pub struct _GDataOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDataOutputStreamPrivate = *mut _GDataOutputStreamPrivate; +pub type GDataOutputStreamPrivate = _GDataOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2483,7 +2487,7 @@ pub struct _GEmblemClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GEmblemClass = *mut _GEmblemClass; +pub type GEmblemClass = _GEmblemClass; #[derive(Copy, Clone)] #[repr(C)] @@ -2505,7 +2509,7 @@ pub struct _GEmblemedIconPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GEmblemedIconPrivate = *mut _GEmblemedIconPrivate; +pub type GEmblemedIconPrivate = _GEmblemedIconPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2657,7 +2661,7 @@ pub struct _GFileEnumeratorPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileEnumeratorPrivate = *mut _GFileEnumeratorPrivate; +pub type GFileEnumeratorPrivate = _GFileEnumeratorPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2744,7 +2748,7 @@ pub struct _GFileIOStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileIOStreamPrivate = *mut _GFileIOStreamPrivate; +pub type GFileIOStreamPrivate = _GFileIOStreamPrivate; #[repr(C)] pub struct _GFileIconClass { @@ -2752,7 +2756,7 @@ pub struct _GFileIconClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileIconClass = *mut _GFileIconClass; +pub type GFileIconClass = _GFileIconClass; #[derive(Copy, Clone)] #[repr(C)] @@ -3531,7 +3535,7 @@ pub struct _GFileInfoClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileInfoClass = *mut _GFileInfoClass; +pub type GFileInfoClass = _GFileInfoClass; #[derive(Copy, Clone)] #[repr(C)] @@ -3605,7 +3609,7 @@ pub struct _GFileInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileInputStreamPrivate = *mut _GFileInputStreamPrivate; +pub type GFileInputStreamPrivate = _GFileInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3642,7 +3646,7 @@ pub struct _GFileMonitorPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileMonitorPrivate = *mut _GFileMonitorPrivate; +pub type GFileMonitorPrivate = _GFileMonitorPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3729,7 +3733,7 @@ pub struct _GFileOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileOutputStreamPrivate = *mut _GFileOutputStreamPrivate; +pub type GFileOutputStreamPrivate = _GFileOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3799,7 +3803,7 @@ pub struct _GIOExtension { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOExtension = *mut _GIOExtension; +pub type GIOExtension = _GIOExtension; #[repr(C)] pub struct _GIOExtensionPoint { @@ -3807,7 +3811,7 @@ pub struct _GIOExtensionPoint { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOExtensionPoint = *mut _GIOExtensionPoint; +pub type GIOExtensionPoint = _GIOExtensionPoint; #[repr(C)] pub struct _GIOModuleClass { @@ -3815,7 +3819,7 @@ pub struct _GIOModuleClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOModuleClass = *mut _GIOModuleClass; +pub type GIOModuleClass = _GIOModuleClass; #[repr(C)] pub struct _GIOModuleScope { @@ -3823,7 +3827,7 @@ pub struct _GIOModuleScope { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOModuleScope = *mut _GIOModuleScope; +pub type GIOModuleScope = _GIOModuleScope; #[repr(C)] pub struct _GIOSchedulerJob { @@ -3831,7 +3835,7 @@ pub struct _GIOSchedulerJob { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOSchedulerJob = *mut _GIOSchedulerJob; +pub type GIOSchedulerJob = _GIOSchedulerJob; #[repr(C)] pub struct _GIOStreamAdapter { @@ -3839,7 +3843,7 @@ pub struct _GIOStreamAdapter { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOStreamAdapter = *mut _GIOStreamAdapter; +pub type GIOStreamAdapter = _GIOStreamAdapter; #[derive(Copy, Clone)] #[repr(C)] @@ -3903,7 +3907,7 @@ pub struct _GIOStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOStreamPrivate = *mut _GIOStreamPrivate; +pub type GIOStreamPrivate = _GIOStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3970,7 +3974,7 @@ pub struct _GInetAddressMaskPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInetAddressMaskPrivate = *mut _GInetAddressMaskPrivate; +pub type GInetAddressMaskPrivate = _GInetAddressMaskPrivate; #[repr(C)] pub struct _GInetAddressPrivate { @@ -3978,7 +3982,7 @@ pub struct _GInetAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInetAddressPrivate = *mut _GInetAddressPrivate; +pub type GInetAddressPrivate = _GInetAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4000,7 +4004,7 @@ pub struct _GInetSocketAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInetSocketAddressPrivate = *mut _GInetSocketAddressPrivate; +pub type GInetSocketAddressPrivate = _GInetSocketAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4160,7 +4164,7 @@ pub struct _GInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInputStreamPrivate = *mut _GInputStreamPrivate; +pub type GInputStreamPrivate = _GInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4285,7 +4289,7 @@ pub struct _GMemoryInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMemoryInputStreamPrivate = *mut _GMemoryInputStreamPrivate; +pub type GMemoryInputStreamPrivate = _GMemoryInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4333,7 +4337,7 @@ pub struct _GMemoryOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMemoryOutputStreamPrivate = *mut _GMemoryOutputStreamPrivate; +pub type GMemoryOutputStreamPrivate = _GMemoryOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4363,7 +4367,7 @@ pub struct _GMenuAttributeIterPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMenuAttributeIterPrivate = *mut _GMenuAttributeIterPrivate; +pub type GMenuAttributeIterPrivate = _GMenuAttributeIterPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4393,7 +4397,7 @@ pub struct _GMenuLinkIterPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMenuLinkIterPrivate = *mut _GMenuLinkIterPrivate; +pub type GMenuLinkIterPrivate = _GMenuLinkIterPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4443,7 +4447,7 @@ pub struct _GMenuModelPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMenuModelPrivate = *mut _GMenuModelPrivate; +pub type GMenuModelPrivate = _GMenuModelPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4660,7 +4664,7 @@ pub struct _GMountOperationPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMountOperationPrivate = *mut _GMountOperationPrivate; +pub type GMountOperationPrivate = _GMountOperationPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4682,7 +4686,7 @@ pub struct _GNativeSocketAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GNativeSocketAddressPrivate = *mut _GNativeSocketAddressPrivate; +pub type GNativeSocketAddressPrivate = _GNativeSocketAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4721,7 +4725,7 @@ pub struct _GNetworkAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GNetworkAddressPrivate = *mut _GNetworkAddressPrivate; +pub type GNetworkAddressPrivate = _GNetworkAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4786,7 +4790,7 @@ pub struct _GNetworkServicePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GNetworkServicePrivate = *mut _GNetworkServicePrivate; +pub type GNetworkServicePrivate = _GNetworkServicePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4986,7 +4990,7 @@ pub struct _GOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GOutputStreamPrivate = *mut _GOutputStreamPrivate; +pub type GOutputStreamPrivate = _GOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5066,7 +5070,7 @@ pub struct _GPermissionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GPermissionPrivate = *mut _GPermissionPrivate; +pub type GPermissionPrivate = _GPermissionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5200,7 +5204,7 @@ pub struct _GProxyAddressEnumeratorPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GProxyAddressEnumeratorPrivate = *mut _GProxyAddressEnumeratorPrivate; +pub type GProxyAddressEnumeratorPrivate = _GProxyAddressEnumeratorPrivate; #[repr(C)] pub struct _GProxyAddressPrivate { @@ -5208,7 +5212,7 @@ pub struct _GProxyAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GProxyAddressPrivate = *mut _GProxyAddressPrivate; +pub type GProxyAddressPrivate = _GProxyAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5497,7 +5501,7 @@ pub struct _GResolverPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GResolverPrivate = *mut _GResolverPrivate; +pub type GResolverPrivate = _GResolverPrivate; #[repr(C)] pub struct GResource { @@ -5614,7 +5618,7 @@ pub struct _GSettingsBackendPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSettingsBackendPrivate = *mut _GSettingsBackendPrivate; +pub type GSettingsBackendPrivate = _GSettingsBackendPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5648,7 +5652,7 @@ pub struct _GSettingsPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSettingsPrivate = *mut _GSettingsPrivate; +pub type GSettingsPrivate = _GSettingsPrivate; #[repr(C)] pub struct GSettingsSchema { @@ -5709,7 +5713,7 @@ pub struct _GSimpleActionGroupPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSimpleActionGroupPrivate = *mut _GSimpleActionGroupPrivate; +pub type GSimpleActionGroupPrivate = _GSimpleActionGroupPrivate; #[repr(C)] pub struct _GSimpleAsyncResultClass { @@ -5717,7 +5721,7 @@ pub struct _GSimpleAsyncResultClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSimpleAsyncResultClass = *mut _GSimpleAsyncResultClass; +pub type GSimpleAsyncResultClass = _GSimpleAsyncResultClass; #[derive(Copy, Clone)] #[repr(C)] @@ -5749,7 +5753,7 @@ pub struct _GSimpleProxyResolverPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSimpleProxyResolverPrivate = *mut _GSimpleProxyResolverPrivate; +pub type GSimpleProxyResolverPrivate = _GSimpleProxyResolverPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5887,7 +5891,7 @@ pub struct _GSocketClientPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketClientPrivate = *mut _GSocketClientPrivate; +pub type GSocketClientPrivate = _GSocketClientPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5943,7 +5947,7 @@ pub struct _GSocketConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketConnectionPrivate = *mut _GSocketConnectionPrivate; +pub type GSocketConnectionPrivate = _GSocketConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5986,7 +5990,7 @@ pub struct _GSocketControlMessagePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketControlMessagePrivate = *mut _GSocketControlMessagePrivate; +pub type GSocketControlMessagePrivate = _GSocketControlMessagePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6023,7 +6027,7 @@ pub struct _GSocketListenerPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketListenerPrivate = *mut _GSocketListenerPrivate; +pub type GSocketListenerPrivate = _GSocketListenerPrivate; #[repr(C)] pub struct _GSocketPrivate { @@ -6031,7 +6035,7 @@ pub struct _GSocketPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketPrivate = *mut _GSocketPrivate; +pub type GSocketPrivate = _GSocketPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6073,7 +6077,7 @@ pub struct _GSocketServicePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketServicePrivate = *mut _GSocketServicePrivate; +pub type GSocketServicePrivate = _GSocketServicePrivate; #[repr(C)] pub struct GSrvTarget { @@ -6110,7 +6114,7 @@ pub struct _GTaskClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTaskClass = *mut _GTaskClass; +pub type GTaskClass = _GTaskClass; #[derive(Copy, Clone)] #[repr(C)] @@ -6132,7 +6136,7 @@ pub struct _GTcpConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTcpConnectionPrivate = *mut _GTcpConnectionPrivate; +pub type GTcpConnectionPrivate = _GTcpConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6154,7 +6158,7 @@ pub struct _GTcpWrapperConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTcpWrapperConnectionPrivate = *mut _GTcpWrapperConnectionPrivate; +pub type GTcpWrapperConnectionPrivate = _GTcpWrapperConnectionPrivate; #[repr(C)] pub struct _GThemedIconClass { @@ -6162,7 +6166,7 @@ pub struct _GThemedIconClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GThemedIconClass = *mut _GThemedIconClass; +pub type GThemedIconClass = _GThemedIconClass; #[derive(Copy, Clone)] #[repr(C)] @@ -6202,7 +6206,7 @@ pub struct _GThreadedSocketServicePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GThreadedSocketServicePrivate = *mut _GThreadedSocketServicePrivate; +pub type GThreadedSocketServicePrivate = _GThreadedSocketServicePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6277,7 +6281,7 @@ pub struct _GTlsCertificatePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsCertificatePrivate = *mut _GTlsCertificatePrivate; +pub type GTlsCertificatePrivate = _GTlsCertificatePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6362,7 +6366,7 @@ pub struct _GTlsConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsConnectionPrivate = *mut _GTlsConnectionPrivate; +pub type GTlsConnectionPrivate = _GTlsConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6540,7 +6544,7 @@ pub struct _GTlsDatabasePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsDatabasePrivate = *mut _GTlsDatabasePrivate; +pub type GTlsDatabasePrivate = _GTlsDatabasePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6636,7 +6640,7 @@ pub struct _GTlsInteractionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsInteractionPrivate = *mut _GTlsInteractionPrivate; +pub type GTlsInteractionPrivate = _GTlsInteractionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6666,7 +6670,7 @@ pub struct _GTlsPasswordPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsPasswordPrivate = *mut _GTlsPasswordPrivate; +pub type GTlsPasswordPrivate = _GTlsPasswordPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6702,7 +6706,7 @@ pub struct _GUnixConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixConnectionPrivate = *mut _GUnixConnectionPrivate; +pub type GUnixConnectionPrivate = _GUnixConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6728,7 +6732,7 @@ pub struct _GUnixCredentialsMessagePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixCredentialsMessagePrivate = *mut _GUnixCredentialsMessagePrivate; +pub type GUnixCredentialsMessagePrivate = _GUnixCredentialsMessagePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6760,7 +6764,7 @@ pub struct _GUnixFDListPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixFDListPrivate = *mut _GUnixFDListPrivate; +pub type GUnixFDListPrivate = _GUnixFDListPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6786,7 +6790,7 @@ pub struct _GUnixFDMessagePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixFDMessagePrivate = *mut _GUnixFDMessagePrivate; +pub type GUnixFDMessagePrivate = _GUnixFDMessagePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6818,7 +6822,7 @@ pub struct _GUnixInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixInputStreamPrivate = *mut _GUnixInputStreamPrivate; +pub type GUnixInputStreamPrivate = _GUnixInputStreamPrivate; #[repr(C)] pub struct GUnixMountEntry { @@ -6839,7 +6843,7 @@ pub struct _GUnixMountMonitorClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixMountMonitorClass = *mut _GUnixMountMonitorClass; +pub type GUnixMountMonitorClass = _GUnixMountMonitorClass; #[repr(C)] pub struct GUnixMountPoint { @@ -6884,7 +6888,7 @@ pub struct _GUnixOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixOutputStreamPrivate = *mut _GUnixOutputStreamPrivate; +pub type GUnixOutputStreamPrivate = _GUnixOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6906,7 +6910,7 @@ pub struct _GUnixSocketAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixSocketAddressPrivate = *mut _GUnixSocketAddressPrivate; +pub type GUnixSocketAddressPrivate = _GUnixSocketAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -8438,6 +8442,19 @@ impl ::std::fmt::Debug for GThemedIcon { } } +#[repr(C)] +pub struct GThreadedResolver { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +impl ::std::fmt::Debug for GThreadedResolver { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GThreadedResolver @ {self:p}")) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GThreadedSocketService { @@ -10150,6 +10167,9 @@ extern "C" { cmdline: *mut GApplicationCommandLine, arg: *const c_char, ) -> *mut GFile; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_application_command_line_done(cmdline: *mut GApplicationCommandLine); pub fn g_application_command_line_get_arguments( cmdline: *mut GApplicationCommandLine, argc: *mut c_int, @@ -10184,11 +10204,23 @@ extern "C" { format: *const c_char, ... ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_application_command_line_print_literal( + cmdline: *mut GApplicationCommandLine, + message: *const c_char, + ); pub fn g_application_command_line_printerr( cmdline: *mut GApplicationCommandLine, format: *const c_char, ... ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_application_command_line_printerr_literal( + cmdline: *mut GApplicationCommandLine, + message: *const c_char, + ); pub fn g_application_command_line_set_exit_status( cmdline: *mut GApplicationCommandLine, exit_status: c_int, @@ -10768,6 +10800,9 @@ extern "C" { error: *mut *mut glib::GError, ) -> *mut GDBusMessage; pub fn g_dbus_message_get_arg0(message: *mut GDBusMessage) -> *const c_char; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_dbus_message_get_arg0_path(message: *mut GDBusMessage) -> *const c_char; pub fn g_dbus_message_get_body(message: *mut GDBusMessage) -> *mut glib::GVariant; pub fn g_dbus_message_get_byte_order(message: *mut GDBusMessage) -> GDBusMessageByteOrder; pub fn g_dbus_message_get_destination(message: *mut GDBusMessage) -> *const c_char; @@ -13410,6 +13445,25 @@ extern "C" { cancellable: *mut GCancellable, error: *mut *mut glib::GError, ) -> ssize_t; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_socket_receive_bytes( + socket: *mut GSocket, + size: size_t, + timeout_us: i64, + cancellable: *mut GCancellable, + error: *mut *mut glib::GError, + ) -> *mut glib::GBytes; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_socket_receive_bytes_from( + socket: *mut GSocket, + address: *mut *mut GSocketAddress, + size: size_t, + timeout_us: i64, + cancellable: *mut GCancellable, + error: *mut *mut glib::GError, + ) -> *mut glib::GBytes; pub fn g_socket_receive_from( socket: *mut GSocket, address: *mut *mut GSocketAddress, @@ -14073,11 +14127,27 @@ extern "C" { format: *const c_char, ... ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_task_return_new_error_literal( + task: *mut GTask, + domain: glib::GQuark, + code: c_int, + message: *const c_char, + ); pub fn g_task_return_pointer( task: *mut GTask, result: gpointer, result_destroy: glib::GDestroyNotify, ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_task_return_prefixed_error( + task: *mut GTask, + error: *mut glib::GError, + format: *const c_char, + ... + ); #[cfg(feature = "v2_64")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] pub fn g_task_return_value(task: *mut GTask, result: *mut gobject::GValue); @@ -14148,6 +14218,11 @@ extern "C" { pub fn g_themed_icon_get_names(icon: *mut GThemedIcon) -> *const *const c_char; pub fn g_themed_icon_prepend_name(icon: *mut GThemedIcon, iconname: *const c_char); + //========================================================================= + // GThreadedResolver + //========================================================================= + pub fn g_threaded_resolver_get_type() -> GType; + //========================================================================= // GThreadedSocketService //========================================================================= diff --git a/gio/sys/tests/abi.rs b/gio/sys/tests/abi.rs index b850ea16184d..fd624564ba79 100644 --- a/gio/sys/tests/abi.rs +++ b/gio/sys/tests/abi.rs @@ -2708,6 +2708,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_FILE_COPY_NONE", "0"), ("(guint) G_FILE_COPY_NO_FALLBACK_FOR_MOVE", "16"), ("(guint) G_FILE_COPY_OVERWRITE", "1"), + ("(guint) G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME", "64"), ("(guint) G_FILE_COPY_TARGET_DEFAULT_PERMS", "32"), ("(guint) G_FILE_CREATE_NONE", "0"), ("(guint) G_FILE_CREATE_PRIVATE", "1"), @@ -2751,6 +2752,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_IO_ERROR_CONNECTION_CLOSED", "44"), ("(gint) G_IO_ERROR_CONNECTION_REFUSED", "39"), ("(gint) G_IO_ERROR_DBUS_ERROR", "36"), + ("(gint) G_IO_ERROR_DESTINATION_UNSET", "48"), ("(gint) G_IO_ERROR_EXISTS", "2"), ("(gint) G_IO_ERROR_FAILED", "0"), ("(gint) G_IO_ERROR_FAILED_HANDLED", "30"), diff --git a/gio/sys/tests/constant.c b/gio/sys/tests/constant.c index 8b47edec2b45..5a013929b96c 100644 --- a/gio/sys/tests/constant.c +++ b/gio/sys/tests/constant.c @@ -325,6 +325,7 @@ int main() { PRINT_CONSTANT((guint) G_FILE_COPY_NONE); PRINT_CONSTANT((guint) G_FILE_COPY_NO_FALLBACK_FOR_MOVE); PRINT_CONSTANT((guint) G_FILE_COPY_OVERWRITE); + PRINT_CONSTANT((guint) G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME); PRINT_CONSTANT((guint) G_FILE_COPY_TARGET_DEFAULT_PERMS); PRINT_CONSTANT((guint) G_FILE_CREATE_NONE); PRINT_CONSTANT((guint) G_FILE_CREATE_PRIVATE); @@ -368,6 +369,7 @@ int main() { PRINT_CONSTANT((gint) G_IO_ERROR_CONNECTION_CLOSED); PRINT_CONSTANT((gint) G_IO_ERROR_CONNECTION_REFUSED); PRINT_CONSTANT((gint) G_IO_ERROR_DBUS_ERROR); + PRINT_CONSTANT((gint) G_IO_ERROR_DESTINATION_UNSET); PRINT_CONSTANT((gint) G_IO_ERROR_EXISTS); PRINT_CONSTANT((gint) G_IO_ERROR_FAILED); PRINT_CONSTANT((gint) G_IO_ERROR_FAILED_HANDLED); diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gir b/gir index a2f936b77195..1c7a6b57a5fc 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit a2f936b771958a65d5314effa6635b2a953a04f4 +Subproject commit 1c7a6b57a5fcc4d87cb82e0535dc49d14babb76b diff --git a/gir-files b/gir-files index 20031a537e40..21b29d0e0c1a 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit 20031a537e4050aec6d290f4250d217e28415da5 +Subproject commit 21b29d0e0c1afee88313b1e23bb5b73d7755c068 diff --git a/glib/Cargo.toml b/glib/Cargo.toml index 8fd6ba4da3d0..a6298136fa39 100644 --- a/glib/Cargo.toml +++ b/glib/Cargo.toml @@ -55,6 +55,7 @@ v2_72 = ["v2_70", "ffi/v2_72", "gobject_ffi/v2_72"] v2_74 = ["v2_72", "ffi/v2_74", "gobject_ffi/v2_74"] v2_76 = ["v2_74", "ffi/v2_76", "gobject_ffi/v2_76"] v2_78 = ["v2_76", "ffi/v2_78", "gobject_ffi/v2_78"] +v2_80 = ["v2_78", "ffi/v2_80", "gobject_ffi/v2_80"] log = ["rs-log"] log_macros = ["log"] compiletests = [] diff --git a/glib/Gir.toml b/glib/Gir.toml index eeab18b39239..379cc8c80f59 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -3,6 +3,7 @@ girs_directories = ["../gir-files"] library = "GLib" version = "2.0" min_cfg_version = "2.56" +use_gi_docgen = true target_path = "." work_mode = "normal" single_version_file = true @@ -55,6 +56,41 @@ manual = [ [[object]] name = "GLib.*" status = "generate" + [[object.function]] + name = "win32_locale_filename_from_utf8" + cfg_condition = "windows" + ignore = true # TODO: implement me + [[object.function]] + name = "win32_get_windows_version" + cfg_condition = "windows" + [[object.function]] + name = "win32_getlocale" + cfg_condition = "windows" + [[object.function]] + name = "win32_check_windows_version" + cfg_condition = "windows" + [[object.function]] + name = "win32_error_message" + cfg_condition = "windows" + [[object.function]] + name = "win32_ftruncate" + cfg_condition = "windows" + ignore = true # TODO: implement me + [[object.function]] + name = "win32_get_command_line" + cfg_condition = "windows" + [[object.function]] + name = "win32_get_package_installation_directory" + cfg_condition = "windows" + ignore = true # TODO: implement me + [[object.function]] + name = "win32_get_package_installation_directory_of_module" + cfg_condition = "windows" + manual = true + [[object.function]] + name = "win32_get_package_installation_subdirectory" + cfg_condition = "windows" + ignore = true # TODO: implement me [[object.function]] pattern = "(assertion_message_cmpint|assert_warning|assertion_message|assertion_message_cmpnum|assertion_message_cmpstr|warn_message|return_if_fail_warning)" ignore = true # Not useful assertions functions @@ -98,6 +134,12 @@ status = "generate" pattern = "(idle_remove_by_data|qsort_with_data)" ignore = true # Unsafe functions [[object.function]] + pattern = "trace_(define_int64_counter|set_int64_counter|mark)" + ignore = true # not useful + [[object.function]] + pattern = "(fopen|creat|chmod|blow_chunks|utime|slice_debug_tree_statistics|rename|remove|open|mkdir|lstat|fsync|freopen|set_prgname_once)" + ignore = true # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + [[object.function]] pattern = "iconv" doc_struct_name = "IConv" manual = true @@ -850,6 +892,9 @@ status = "generate" [[object.member]] name = "close_paranthesis" ignore = true + [[object.member]] + pattern = "(aksara|aksara_pre_base|aksara_start|virama_final|virama)" + version = "2.80" [[object]] name = "GLib.UnicodeScript" @@ -883,3 +928,8 @@ status = "generate" name = "GLib.Uri" status = "generate" concurrency = "send+sync" + +[[object]] +name = "GLib.Win32OSType" +status = "generate" +cfg_condition = "windows" diff --git a/glib/gobject-sys/Cargo.toml b/glib/gobject-sys/Cargo.toml index bf707ef3a3d1..df1a623d1f35 100644 --- a/glib/gobject-sys/Cargo.toml +++ b/glib/gobject-sys/Cargo.toml @@ -22,6 +22,7 @@ v2_72 = ["v2_70"] v2_74 = ["v2_72"] v2_76 = ["v2_74"] v2_78 = ["v2_74"] +v2_80 = ["v2_78"] [lib] name = "gobject_sys" @@ -70,6 +71,9 @@ version = "2.76" [package.metadata.system-deps.gobject_2_0.v2_78] version = "2.77" +[package.metadata.system-deps.gobject_2_0.v2_80] +version = "2.79" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] diff --git a/glib/gobject-sys/src/lib.rs b/glib/gobject-sys/src/lib.rs index b6e648034548..edc502d38ea8 100644 --- a/glib/gobject-sys/src/lib.rs +++ b/glib/gobject-sys/src/lib.rs @@ -53,13 +53,14 @@ pub const G_PARAM_USER_SHIFT: c_int = 8; pub const G_SIGNAL_FLAGS_MASK: c_int = 511; pub const G_SIGNAL_MATCH_MASK: c_int = 63; pub const G_TYPE_FLAG_RESERVED_ID_BIT: GType = 1; -pub const G_TYPE_FUNDAMENTAL_MAX: c_int = 255; +pub const G_TYPE_FUNDAMENTAL_MAX: c_int = 1020; pub const G_TYPE_FUNDAMENTAL_SHIFT: c_int = 2; pub const G_TYPE_RESERVED_BSE_FIRST: c_int = 32; pub const G_TYPE_RESERVED_BSE_LAST: c_int = 48; pub const G_TYPE_RESERVED_GLIB_FIRST: c_int = 22; pub const G_TYPE_RESERVED_GLIB_LAST: c_int = 31; pub const G_TYPE_RESERVED_USER_FIRST: c_int = 49; +pub const G_VALUE_COLLECT_FORMAT_MAX_LENGTH: c_int = 8; pub const G_VALUE_INTERNED_STRING: c_int = 268435456; pub const G_VALUE_NOCOPY_CONTENTS: c_int = 134217728; @@ -75,6 +76,14 @@ pub const G_CONNECT_DEFAULT: GConnectFlags = 0; pub const G_CONNECT_AFTER: GConnectFlags = 1; pub const G_CONNECT_SWAPPED: GConnectFlags = 2; +pub type GIOCondition = c_uint; +pub const G_IO_IN: GIOCondition = 1; +pub const G_IO_OUT: GIOCondition = 4; +pub const G_IO_PRI: GIOCondition = 2; +pub const G_IO_ERR: GIOCondition = 8; +pub const G_IO_HUP: GIOCondition = 16; +pub const G_IO_NVAL: GIOCondition = 32; + pub type GParamFlags = c_uint; pub const G_PARAM_READABLE: GParamFlags = 1; pub const G_PARAM_WRITABLE: GParamFlags = 2; @@ -130,15 +139,25 @@ pub const G_TYPE_FLAG_DERIVABLE: GTypeFundamentalFlags = 4; pub const G_TYPE_FLAG_DEEP_DERIVABLE: GTypeFundamentalFlags = 8; // Unions +#[derive(Copy, Clone)] #[repr(C)] -pub struct GTypeCValue { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +pub union GTypeCValue { + pub v_int: c_int, + pub v_long: c_long, + pub v_int64: i64, + pub v_double: c_double, + pub v_pointer: gpointer, } impl ::std::fmt::Debug for GTypeCValue { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("GTypeCValue @ {self:p}")).finish() + f.debug_struct(&format!("GTypeCValue @ {self:p}")) + .field("v_int", unsafe { &self.v_int }) + .field("v_long", unsafe { &self.v_long }) + .field("v_int64", unsafe { &self.v_int64 }) + .field("v_double", unsafe { &self.v_double }) + .field("v_pointer", unsafe { &self.v_pointer }) + .finish() } } @@ -514,7 +533,7 @@ pub struct _GParamSpecPool { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GParamSpecPool = *mut _GParamSpecPool; +pub type GParamSpecPool = _GParamSpecPool; #[derive(Copy, Clone)] #[repr(C)] @@ -1391,6 +1410,11 @@ extern "C" { //========================================================================= pub fn g_binding_flags_get_type() -> GType; + //========================================================================= + // GIOCondition + //========================================================================= + pub fn g_io_condition_get_type() -> GType; + //========================================================================= // GCClosure //========================================================================= @@ -1698,6 +1722,9 @@ extern "C" { //========================================================================= // GParamSpecPool //========================================================================= + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_param_spec_pool_free(pool: *mut GParamSpecPool); pub fn g_param_spec_pool_insert( pool: *mut GParamSpecPool, pspec: *mut GParamSpec, @@ -1836,6 +1863,9 @@ extern "C" { pub fn g_value_set_uint64(value: *mut GValue, v_uint64: u64); pub fn g_value_set_ulong(value: *mut GValue, v_ulong: c_ulong); pub fn g_value_set_variant(value: *mut GValue, variant: *mut glib::GVariant); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_value_steal_string(value: *mut GValue) -> *mut c_char; pub fn g_value_take_boxed(value: *mut GValue, v_boxed: gconstpointer); pub fn g_value_take_object(value: *mut GValue, v_object: gpointer); pub fn g_value_take_param(value: *mut GValue, param: *mut GParamSpec); @@ -2704,8 +2734,6 @@ extern "C" { pub fn g_signal_stop_emission(instance: *mut GObject, signal_id: c_uint, detail: glib::GQuark); pub fn g_signal_stop_emission_by_name(instance: *mut GObject, detailed_signal: *const c_char); pub fn g_signal_type_cclosure_new(itype: GType, struct_offset: c_uint) -> *mut GClosure; - pub fn g_source_set_closure(source: *mut glib::GSource, closure: *mut GClosure); - pub fn g_source_set_dummy_callback(source: *mut glib::GSource); pub fn g_strdup_value_contents(value: *const GValue) -> *mut c_char; pub fn g_type_add_class_cache_func(cache_data: gpointer, cache_func: GTypeClassCacheFunc); pub fn g_type_add_class_private(class_type: GType, private_size: size_t); @@ -2794,5 +2822,6 @@ extern "C" { pub fn g_type_remove_interface_check(check_data: gpointer, check_func: GTypeInterfaceCheckFunc); pub fn g_type_set_qdata(type_: GType, quark: glib::GQuark, data: gpointer); pub fn g_type_test_flags(type_: GType, flags: c_uint) -> gboolean; + pub fn g_variant_get_gtype() -> GType; } diff --git a/glib/gobject-sys/tests/abi.rs b/glib/gobject-sys/tests/abi.rs index cdda3dd9dc88..db68c468caff 100644 --- a/glib/gobject-sys/tests/abi.rs +++ b/glib/gobject-sys/tests/abi.rs @@ -250,6 +250,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GIOCondition", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GInitiallyUnowned", Layout { @@ -516,6 +523,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GTypeCValue", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GTypeClass", Layout { @@ -638,6 +652,12 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_CONNECT_AFTER", "1"), ("(guint) G_CONNECT_DEFAULT", "0"), ("(guint) G_CONNECT_SWAPPED", "2"), + ("(guint) G_IO_ERR", "8"), + ("(guint) G_IO_HUP", "16"), + ("(guint) G_IO_IN", "1"), + ("(guint) G_IO_NVAL", "32"), + ("(guint) G_IO_OUT", "4"), + ("(guint) G_IO_PRI", "2"), ("(guint) G_PARAM_CONSTRUCT", "4"), ("(guint) G_PARAM_CONSTRUCT_ONLY", "8"), ("(guint) G_PARAM_DEPRECATED", "2147483648"), @@ -686,13 +706,14 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_TYPE_FLAG_NONE", "0"), ("G_TYPE_FLAG_RESERVED_ID_BIT", "1"), ("(guint) G_TYPE_FLAG_VALUE_ABSTRACT", "32"), - ("G_TYPE_FUNDAMENTAL_MAX", "255"), + ("G_TYPE_FUNDAMENTAL_MAX", "1020"), ("G_TYPE_FUNDAMENTAL_SHIFT", "2"), ("G_TYPE_RESERVED_BSE_FIRST", "32"), ("G_TYPE_RESERVED_BSE_LAST", "48"), ("G_TYPE_RESERVED_GLIB_FIRST", "22"), ("G_TYPE_RESERVED_GLIB_LAST", "31"), ("G_TYPE_RESERVED_USER_FIRST", "49"), + ("G_VALUE_COLLECT_FORMAT_MAX_LENGTH", "8"), ("G_VALUE_INTERNED_STRING", "268435456"), ("G_VALUE_NOCOPY_CONTENTS", "134217728"), ]; diff --git a/glib/gobject-sys/tests/constant.c b/glib/gobject-sys/tests/constant.c index 19ffa724fb77..89e383736dd9 100644 --- a/glib/gobject-sys/tests/constant.c +++ b/glib/gobject-sys/tests/constant.c @@ -35,6 +35,12 @@ int main() { PRINT_CONSTANT((guint) G_CONNECT_AFTER); PRINT_CONSTANT((guint) G_CONNECT_DEFAULT); PRINT_CONSTANT((guint) G_CONNECT_SWAPPED); + PRINT_CONSTANT((guint) G_IO_ERR); + PRINT_CONSTANT((guint) G_IO_HUP); + PRINT_CONSTANT((guint) G_IO_IN); + PRINT_CONSTANT((guint) G_IO_NVAL); + PRINT_CONSTANT((guint) G_IO_OUT); + PRINT_CONSTANT((guint) G_IO_PRI); PRINT_CONSTANT((guint) G_PARAM_CONSTRUCT); PRINT_CONSTANT((guint) G_PARAM_CONSTRUCT_ONLY); PRINT_CONSTANT((guint) G_PARAM_DEPRECATED); @@ -90,6 +96,7 @@ int main() { PRINT_CONSTANT(G_TYPE_RESERVED_GLIB_FIRST); PRINT_CONSTANT(G_TYPE_RESERVED_GLIB_LAST); PRINT_CONSTANT(G_TYPE_RESERVED_USER_FIRST); + PRINT_CONSTANT(G_VALUE_COLLECT_FORMAT_MAX_LENGTH); PRINT_CONSTANT(G_VALUE_INTERNED_STRING); PRINT_CONSTANT(G_VALUE_NOCOPY_CONTENTS); return 0; diff --git a/glib/gobject-sys/tests/layout.c b/glib/gobject-sys/tests/layout.c index 528e56993792..67f5bc515532 100644 --- a/glib/gobject-sys/tests/layout.c +++ b/glib/gobject-sys/tests/layout.c @@ -14,6 +14,7 @@ int main() { printf("%s;%zu;%zu\n", "GEnumValue", sizeof(GEnumValue), alignof(GEnumValue)); printf("%s;%zu;%zu\n", "GFlagsClass", sizeof(GFlagsClass), alignof(GFlagsClass)); printf("%s;%zu;%zu\n", "GFlagsValue", sizeof(GFlagsValue), alignof(GFlagsValue)); + printf("%s;%zu;%zu\n", "GIOCondition", sizeof(GIOCondition), alignof(GIOCondition)); printf("%s;%zu;%zu\n", "GInitiallyUnowned", sizeof(GInitiallyUnowned), alignof(GInitiallyUnowned)); printf("%s;%zu;%zu\n", "GInitiallyUnownedClass", sizeof(GInitiallyUnownedClass), alignof(GInitiallyUnownedClass)); printf("%s;%zu;%zu\n", "GInterfaceInfo", sizeof(GInterfaceInfo), alignof(GInterfaceInfo)); @@ -52,6 +53,7 @@ int main() { printf("%s;%zu;%zu\n", "GSignalInvocationHint", sizeof(GSignalInvocationHint), alignof(GSignalInvocationHint)); printf("%s;%zu;%zu\n", "GSignalMatchType", sizeof(GSignalMatchType), alignof(GSignalMatchType)); printf("%s;%zu;%zu\n", "GSignalQuery", sizeof(GSignalQuery), alignof(GSignalQuery)); + printf("%s;%zu;%zu\n", "GTypeCValue", sizeof(GTypeCValue), alignof(GTypeCValue)); printf("%s;%zu;%zu\n", "GTypeClass", sizeof(GTypeClass), alignof(GTypeClass)); printf("%s;%zu;%zu\n", "GTypeDebugFlags", sizeof(GTypeDebugFlags), alignof(GTypeDebugFlags)); printf("%s;%zu;%zu\n", "GTypeFlags", sizeof(GTypeFlags), alignof(GTypeFlags)); diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/glib/src/auto/date_time.rs b/glib/src/auto/date_time.rs index 6281dd9bdbdd..a23362b85d5e 100644 --- a/glib/src/auto/date_time.rs +++ b/glib/src/auto/date_time.rs @@ -77,6 +77,17 @@ impl DateTime { } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_date_time_new_from_unix_local_usec")] + #[doc(alias = "new_from_unix_local_usec")] + pub fn from_unix_local_usec(usecs: i64) -> Result { + unsafe { + Option::<_>::from_glib_full(ffi::g_date_time_new_from_unix_local_usec(usecs)) + .ok_or_else(|| crate::bool_error!("Invalid date")) + } + } + #[doc(alias = "g_date_time_new_from_unix_utc")] #[doc(alias = "new_from_unix_utc")] pub fn from_unix_utc(t: i64) -> Result { @@ -86,6 +97,17 @@ impl DateTime { } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_date_time_new_from_unix_utc_usec")] + #[doc(alias = "new_from_unix_utc_usec")] + pub fn from_unix_utc_usec(usecs: i64) -> Result { + unsafe { + Option::<_>::from_glib_full(ffi::g_date_time_new_from_unix_utc_usec(usecs)) + .ok_or_else(|| crate::bool_error!("Invalid date")) + } + } + #[doc(alias = "g_date_time_new_local")] #[doc(alias = "new_local")] pub fn from_local( @@ -455,6 +477,13 @@ impl DateTime { unsafe { ffi::g_date_time_to_unix(self.to_glib_none().0) } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_date_time_to_unix_usec")] + pub fn to_unix_usec(&self) -> i64 { + unsafe { ffi::g_date_time_to_unix_usec(self.to_glib_none().0) } + } + #[doc(alias = "g_date_time_to_utc")] pub fn to_utc(&self) -> Result { unsafe { diff --git a/glib/src/auto/enums.rs b/glib/src/auto/enums.rs index 036d1b61cd93..ffa1d3408041 100644 --- a/glib/src/auto/enums.rs +++ b/glib/src/auto/enums.rs @@ -664,6 +664,60 @@ impl FromGlib for NormalizeMode { } } +impl StaticType for NormalizeMode { + #[inline] + #[doc(alias = "g_normalize_mode_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_normalize_mode_get_type()) } + } +} + +impl crate::HasParamSpec for NormalizeMode { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for NormalizeMode { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for NormalizeMode { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for NormalizeMode { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: NormalizeMode) -> Self { + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GOptionArg")] @@ -904,6 +958,26 @@ pub enum UnicodeBreakType { EmojiModifier, #[doc(alias = "G_UNICODE_BREAK_ZERO_WIDTH_JOINER")] ZeroWidthJoiner, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_UNICODE_BREAK_AKSARA")] + Aksara, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_UNICODE_BREAK_AKSARA_PRE_BASE")] + AksaraPreBase, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_UNICODE_BREAK_AKSARA_START")] + AksaraStart, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_UNICODE_BREAK_VIRAMA_FINAL")] + ViramaFinal, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "G_UNICODE_BREAK_VIRAMA")] + Virama, #[doc(hidden)] __Unknown(i32), } @@ -957,6 +1031,16 @@ impl IntoGlib for UnicodeBreakType { Self::EmojiBase => ffi::G_UNICODE_BREAK_EMOJI_BASE, Self::EmojiModifier => ffi::G_UNICODE_BREAK_EMOJI_MODIFIER, Self::ZeroWidthJoiner => ffi::G_UNICODE_BREAK_ZERO_WIDTH_JOINER, + #[cfg(feature = "v2_80")] + Self::Aksara => ffi::G_UNICODE_BREAK_AKSARA, + #[cfg(feature = "v2_80")] + Self::AksaraPreBase => ffi::G_UNICODE_BREAK_AKSARA_PRE_BASE, + #[cfg(feature = "v2_80")] + Self::AksaraStart => ffi::G_UNICODE_BREAK_AKSARA_START, + #[cfg(feature = "v2_80")] + Self::ViramaFinal => ffi::G_UNICODE_BREAK_VIRAMA_FINAL, + #[cfg(feature = "v2_80")] + Self::Virama => ffi::G_UNICODE_BREAK_VIRAMA, Self::__Unknown(value) => value, } } @@ -1009,11 +1093,75 @@ impl FromGlib for UnicodeBreakType { ffi::G_UNICODE_BREAK_EMOJI_BASE => Self::EmojiBase, ffi::G_UNICODE_BREAK_EMOJI_MODIFIER => Self::EmojiModifier, ffi::G_UNICODE_BREAK_ZERO_WIDTH_JOINER => Self::ZeroWidthJoiner, + #[cfg(feature = "v2_80")] + ffi::G_UNICODE_BREAK_AKSARA => Self::Aksara, + #[cfg(feature = "v2_80")] + ffi::G_UNICODE_BREAK_AKSARA_PRE_BASE => Self::AksaraPreBase, + #[cfg(feature = "v2_80")] + ffi::G_UNICODE_BREAK_AKSARA_START => Self::AksaraStart, + #[cfg(feature = "v2_80")] + ffi::G_UNICODE_BREAK_VIRAMA_FINAL => Self::ViramaFinal, + #[cfg(feature = "v2_80")] + ffi::G_UNICODE_BREAK_VIRAMA => Self::Virama, value => Self::__Unknown(value), } } } +impl StaticType for UnicodeBreakType { + #[inline] + #[doc(alias = "g_unicode_break_type_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_unicode_break_type_get_type()) } + } +} + +impl crate::HasParamSpec for UnicodeBreakType { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for UnicodeBreakType { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for UnicodeBreakType { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for UnicodeBreakType { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: UnicodeBreakType) -> Self { + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GUnicodeScript")] @@ -1370,6 +1518,18 @@ pub enum UnicodeScript { __Unknown(i32), } +impl UnicodeScript { + #[doc(alias = "g_unicode_script_from_iso15924")] + pub fn from_iso15924(iso15924: u32) -> UnicodeScript { + unsafe { from_glib(ffi::g_unicode_script_from_iso15924(iso15924)) } + } + + #[doc(alias = "g_unicode_script_to_iso15924")] + pub fn to_iso15924(self) -> u32 { + unsafe { ffi::g_unicode_script_to_iso15924(self.into_glib()) } + } +} + #[doc(hidden)] impl IntoGlib for UnicodeScript { type GlibType = ffi::GUnicodeScript; @@ -1738,6 +1898,60 @@ impl FromGlib for UnicodeScript { } } +impl StaticType for UnicodeScript { + #[inline] + #[doc(alias = "g_unicode_script_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_unicode_script_get_type()) } + } +} + +impl crate::HasParamSpec for UnicodeScript { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for UnicodeScript { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for UnicodeScript { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for UnicodeScript { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: UnicodeScript) -> Self { + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GUnicodeType")] @@ -1886,6 +2100,60 @@ impl FromGlib for UnicodeType { } } +impl StaticType for UnicodeType { + #[inline] + #[doc(alias = "g_unicode_type_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_unicode_type_get_type()) } + } +} + +impl crate::HasParamSpec for UnicodeType { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for UnicodeType { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for UnicodeType { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for UnicodeType { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: UnicodeType) -> Self { + ToValue::to_value(&v) + } +} + #[cfg(feature = "v2_66")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] @@ -2084,3 +2352,49 @@ impl FromGlib for VariantClass { } } } + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GWin32OSType")] +pub enum Win32OSType { + #[doc(alias = "G_WIN32_OS_ANY")] + Any, + #[doc(alias = "G_WIN32_OS_WORKSTATION")] + Workstation, + #[doc(alias = "G_WIN32_OS_SERVER")] + Server, + #[doc(hidden)] + __Unknown(i32), +} + +#[cfg(windows)] +#[doc(hidden)] +impl IntoGlib for Win32OSType { + type GlibType = ffi::GWin32OSType; + + #[inline] + fn into_glib(self) -> ffi::GWin32OSType { + match self { + Self::Any => ffi::G_WIN32_OS_ANY, + Self::Workstation => ffi::G_WIN32_OS_WORKSTATION, + Self::Server => ffi::G_WIN32_OS_SERVER, + Self::__Unknown(value) => value, + } + } +} + +#[cfg(windows)] +#[doc(hidden)] +impl FromGlib for Win32OSType { + #[inline] + unsafe fn from_glib(value: ffi::GWin32OSType) -> Self { + match value { + ffi::G_WIN32_OS_ANY => Self::Any, + ffi::G_WIN32_OS_WORKSTATION => Self::Workstation, + ffi::G_WIN32_OS_SERVER => Self::Server, + value => Self::__Unknown(value), + } + } +} diff --git a/glib/src/auto/functions.rs b/glib/src/auto/functions.rs index ae819b6236ee..fd6d1555671b 100644 --- a/glib/src/auto/functions.rs +++ b/glib/src/auto/functions.rs @@ -5,9 +5,12 @@ #[cfg(feature = "v2_66")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] use crate::FileSetContentsFlags; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +use crate::Win32OSType; use crate::{ translate::*, Bytes, ChecksumType, Error, FileTest, FormatSizeFlags, Pid, Source, SpawnFlags, - UnicodeScript, UserDirectory, + UserDirectory, }; use std::boxed::Box as Box_; @@ -627,6 +630,11 @@ pub fn set_application_name(application_name: &str) { } } +//#[doc(alias = "g_set_user_dirs")] +//pub fn set_user_dirs(first_dir_type: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { +// unsafe { TODO: call ffi:g_set_user_dirs() } +//} + #[doc(alias = "g_setenv")] pub fn setenv( variable: impl AsRef, @@ -814,15 +822,10 @@ pub fn spawn_command_line_async( // unsafe { TODO: call ffi:g_spawn_sync() } //} -#[doc(alias = "g_unicode_script_from_iso15924")] -pub fn unicode_script_from_iso15924(iso15924: u32) -> UnicodeScript { - unsafe { from_glib(ffi::g_unicode_script_from_iso15924(iso15924)) } -} - -#[doc(alias = "g_unicode_script_to_iso15924")] -pub fn unicode_script_to_iso15924(script: UnicodeScript) -> u32 { - unsafe { ffi::g_unicode_script_to_iso15924(script.into_glib()) } -} +//#[doc(alias = "g_stat")] +//pub fn stat(filename: impl AsRef, buf: /*Ignored*/&mut StatBuf) -> i32 { +// unsafe { TODO: call ffi:g_stat() } +//} //#[cfg(unix)] //#[cfg_attr(docsrs, doc(cfg(unix)))] @@ -861,3 +864,50 @@ pub fn uuid_string_is_valid(str: &str) -> bool { pub fn uuid_string_random() -> crate::GString { unsafe { from_glib_full(ffi::g_uuid_string_random()) } } + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[doc(alias = "g_win32_check_windows_version")] +pub fn win32_check_windows_version( + major: i32, + minor: i32, + spver: i32, + os_type: Win32OSType, +) -> bool { + unsafe { + from_glib(ffi::g_win32_check_windows_version( + major, + minor, + spver, + os_type.into_glib(), + )) + } +} + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[doc(alias = "g_win32_error_message")] +pub fn win32_error_message(error: i32) -> crate::GString { + unsafe { from_glib_full(ffi::g_win32_error_message(error)) } +} + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[doc(alias = "g_win32_get_command_line")] +pub fn win32_get_command_line() -> Vec { + unsafe { FromGlibPtrContainer::from_glib_none(ffi::g_win32_get_command_line()) } +} + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[doc(alias = "g_win32_get_windows_version")] +pub fn win32_get_windows_version() -> u32 { + unsafe { ffi::g_win32_get_windows_version() } +} + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[doc(alias = "g_win32_getlocale")] +pub fn win32_getlocale() -> crate::GString { + unsafe { from_glib_full(ffi::g_win32_getlocale()) } +} diff --git a/glib/src/auto/markup_parse_context.rs b/glib/src/auto/markup_parse_context.rs index bfaf48b87711..2d9703e5d5b5 100644 --- a/glib/src/auto/markup_parse_context.rs +++ b/glib/src/auto/markup_parse_context.rs @@ -45,11 +45,15 @@ impl MarkupParseContext { } } - //#[doc(alias = "g_markup_parse_context_get_element_stack")] - //#[doc(alias = "get_element_stack")] - //pub fn element_stack(&self) -> /*Unimplemented*/Vec { - // unsafe { TODO: call ffi:g_markup_parse_context_get_element_stack() } - //} + #[doc(alias = "g_markup_parse_context_get_element_stack")] + #[doc(alias = "get_element_stack")] + pub fn element_stack(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::g_markup_parse_context_get_element_stack( + self.to_glib_none().0, + )) + } + } #[doc(alias = "g_markup_parse_context_get_position")] #[doc(alias = "get_position")] diff --git a/glib/src/auto/mod.rs b/glib/src/auto/mod.rs index 0330de419bf6..b58e76d01b1a 100644 --- a/glib/src/auto/mod.rs +++ b/glib/src/auto/mod.rs @@ -56,6 +56,9 @@ pub use self::enums::UnicodeType; #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] pub use self::enums::UriError; pub use self::enums::VariantClass; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub use self::enums::Win32OSType; mod flags; #[cfg(feature = "v2_66")] diff --git a/glib/src/auto/regex.rs b/glib/src/auto/regex.rs index d41ce1f7354b..b24c8d6cf0b9 100644 --- a/glib/src/auto/regex.rs +++ b/glib/src/auto/regex.rs @@ -81,7 +81,7 @@ impl Regex { } //#[doc(alias = "g_regex_replace_eval")] - //pub fn replace_eval(&self, string: &[&str], start_position: i32, match_options: RegexMatchFlags, eval: /*Unimplemented*/Fn(&MatchInfo, /*Ignored*/String) -> bool, user_data: /*Unimplemented*/Option) -> Result { + //pub fn replace_eval(&self, string: &[&str], start_position: i32, match_options: RegexMatchFlags, eval: /*Unimplemented*/FnMut(&MatchInfo, /*Ignored*/String) -> bool, user_data: /*Unimplemented*/Option) -> Result { // unsafe { TODO: call ffi:g_regex_replace_eval() } //} } diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/glib/src/win32.rs b/glib/src/win32.rs index 4e2984c56e77..e807d0183ac9 100644 --- a/glib/src/win32.rs +++ b/glib/src/win32.rs @@ -2,59 +2,7 @@ use std::path::PathBuf; -use crate::{translate::*, GString, StrV}; - -#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] -pub enum OSType { - #[doc(alias = "G_WIN32_OS_ANY")] - Any, - #[doc(alias = "G_WIN32_OS_WORKSTATION")] - Workstation, - #[doc(alias = "G_WIN32_OS_SERVER")] - Server, -} - -#[doc(hidden)] -impl IntoGlib for OSType { - type GlibType = ffi::GWin32OSType; - - #[inline] - fn into_glib(self) -> Self::GlibType { - match self { - Self::Any => ffi::G_WIN32_OS_ANY, - Self::Workstation => ffi::G_WIN32_OS_WORKSTATION, - Self::Server => ffi::G_WIN32_OS_SERVER, - } - } -} - -#[doc(alias = "g_win32_check_windows_version")] -pub fn check_windows_version(major: i32, minor: i32, spver: i32, os_type: OSType) -> bool { - unsafe { - from_glib(ffi::g_win32_check_windows_version( - major, - minor, - spver, - os_type.into_glib(), - )) - } -} - -#[doc(alias = "g_win32_get_command_line")] -#[doc(alias = "get_command_line")] -pub fn command_line() -> StrV { - unsafe { FromGlibPtrContainer::from_glib_full(ffi::g_win32_get_command_line()) } -} - -#[doc(alias = "g_win32_error_message")] -pub fn error_message(error: i32) -> GString { - unsafe { from_glib_full(ffi::g_win32_error_message(error)) } -} - -#[doc(alias = "g_win32_getlocale")] -pub fn getlocale() -> GString { - unsafe { from_glib_full(ffi::g_win32_getlocale()) } -} +use crate::translate::*; #[doc(alias = "g_win32_get_package_installation_directory_of_module")] #[doc(alias = "get_package_installation_directory_of_module")] diff --git a/glib/sys/Cargo.toml b/glib/sys/Cargo.toml index a64b5fa739a9..faa919611ff7 100644 --- a/glib/sys/Cargo.toml +++ b/glib/sys/Cargo.toml @@ -20,6 +20,7 @@ v2_72 = ["v2_70"] v2_74 = ["v2_72"] v2_76 = ["v2_74"] v2_78 = ["v2_76"] +v2_80 = ["v2_78"] [lib] name = "glib_sys" @@ -74,6 +75,9 @@ version = "2.76" [package.metadata.system-deps.glib_2_0.v2_78] version = "2.77" +[package.metadata.system-deps.glib_2_0.v2_80] +version = "2.79" + [package.metadata.system-deps.gobject_2_0] name = "gobject-2.0" version = "2.56" diff --git a/glib/sys/Gir.toml b/glib/sys/Gir.toml index c5c66fec5fe3..1e5f31209400 100644 --- a/glib/sys/Gir.toml +++ b/glib/sys/Gir.toml @@ -68,36 +68,50 @@ ignore = [ name = "GLib.*" status = "generate" [[object.function]] - name = "unix_get_passwd_entry" - cfg_condition = "unix" + pattern = "trace_(define_int64_counter|set_int64_counter|mark)" + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + ignore = true [[object.function]] - name = "get_user_state_dir" - version = "2.72" + pattern = "(fopen|creat|chmod|blow_chunks|utime|slice_debug_tree_statistics|rename|remove|open|mkdir|lstat|fsync|freopen|set_prgname_once)" + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + majority of those are available through std + ignore = true + [[object.function]] + name = "win32_locale_filename_from_utf8" + cfg_condition = "windows" + [[object.function]] + name = "win32_get_windows_version" + cfg_condition = "windows" + [[object.function]] + name = "win32_getlocale" + cfg_condition = "windows" [[object.function]] - name = "check_windows_version" - manual = true + name = "win32_check_windows_version" cfg_condition = "windows" [[object.function]] - name = "get_command_line" - manual = true + name = "win32_error_message" cfg_condition = "windows" [[object.function]] - name = "error_message" - manual = true + name = "win32_ftruncate" cfg_condition = "windows" [[object.function]] - name = "getlocale" - manual = true + name = "win32_get_command_line" cfg_condition = "windows" [[object.function]] - name = "get_package_installation_directory_of_module" - manual = true + name = "win32_get_package_installation_directory" cfg_condition = "windows" [[object.function]] - name = "locale_filename_from_utf8" - manual = true + name = "win32_get_package_installation_directory_of_module" cfg_condition = "windows" [[object.function]] + name = "win32_get_package_installation_subdirectory" + cfg_condition = "windows" + [[object.function]] + name = "unix_get_passwd_entry" + cfg_condition = "unix" + [[object.function]] + name = "get_user_state_dir" + version = "2.72" + [[object.function]] name = "assertion_message_cmpint" version = "2.78" @@ -114,11 +128,26 @@ status = "manual" name = "GLib.PollFD" status = "manual" +[[object]] +name = "GLib.UnixPipe" +status = "generate" +cfg_condition = "unix" + +[[object]] +name = "GLib.UnixPipeEnd" +status = "generate" +cfg_condition = "unix" + [[object]] name = "GLib.TestLogMsg" # layout is broken due to rust having no long double status = "ignore" +[[object]] +name = "GLib.Win32OSType" +status = "generate" +cfg_condition = "windows" + [[object]] name = "GLib.macro__has_attribute___noreturn__" # C-only macro diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index a38bf05bfa8e..a57bcf7f18ce 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -41,7 +41,6 @@ pub type GRefString = c_char; pub type GStrv = *mut *mut c_char; pub type GTime = i32; pub type GTimeSpan = i64; -pub type GType = size_t; // Enums pub type GBookmarkFileError = c_int; @@ -344,6 +343,12 @@ pub const G_TEST_RUN_INCOMPLETE: GTestResult = 3; pub type GThreadError = c_int; pub const G_THREAD_ERROR_AGAIN: GThreadError = 0; +pub type GThreadPriority = c_int; +pub const G_THREAD_PRIORITY_LOW: GThreadPriority = 0; +pub const G_THREAD_PRIORITY_NORMAL: GThreadPriority = 1; +pub const G_THREAD_PRIORITY_HIGH: GThreadPriority = 2; +pub const G_THREAD_PRIORITY_URGENT: GThreadPriority = 3; + pub type GTimeType = c_int; pub const G_TIME_TYPE_STANDARD: GTimeType = 0; pub const G_TIME_TYPE_DAYLIGHT: GTimeType = 1; @@ -425,6 +430,11 @@ pub const G_UNICODE_BREAK_REGIONAL_INDICATOR: GUnicodeBreakType = 39; pub const G_UNICODE_BREAK_EMOJI_BASE: GUnicodeBreakType = 40; pub const G_UNICODE_BREAK_EMOJI_MODIFIER: GUnicodeBreakType = 41; pub const G_UNICODE_BREAK_ZERO_WIDTH_JOINER: GUnicodeBreakType = 42; +pub const G_UNICODE_BREAK_AKSARA: GUnicodeBreakType = 43; +pub const G_UNICODE_BREAK_AKSARA_PRE_BASE: GUnicodeBreakType = 44; +pub const G_UNICODE_BREAK_AKSARA_START: GUnicodeBreakType = 45; +pub const G_UNICODE_BREAK_VIRAMA_FINAL: GUnicodeBreakType = 46; +pub const G_UNICODE_BREAK_VIRAMA: GUnicodeBreakType = 47; pub type GUnicodeScript = c_int; pub const G_UNICODE_SCRIPT_INVALID_CODE: GUnicodeScript = -1; @@ -626,6 +636,16 @@ pub const G_UNICODE_LINE_SEPARATOR: GUnicodeType = 27; pub const G_UNICODE_PARAGRAPH_SEPARATOR: GUnicodeType = 28; pub const G_UNICODE_SPACE_SEPARATOR: GUnicodeType = 29; +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] +pub type GUnixPipeEnd = c_int; +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] +pub const G_UNIX_PIPE_END_READ: GUnixPipeEnd = 0; +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] +pub const G_UNIX_PIPE_END_WRITE: GUnixPipeEnd = 1; + pub type GUriError = c_int; pub const G_URI_ERROR_FAILED: GUriError = 0; pub const G_URI_ERROR_BAD_SCHEME: GUriError = 1; @@ -690,7 +710,25 @@ pub const G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT: GVariantParseError pub const G_VARIANT_PARSE_ERROR_VALUE_EXPECTED: GVariantParseError = 17; pub const G_VARIANT_PARSE_ERROR_RECURSION: GVariantParseError = 18; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub type GWin32OSType = c_int; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub const G_WIN32_OS_ANY: GWin32OSType = 0; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub const G_WIN32_OS_SERVER: GWin32OSType = 2; + // Constants +pub const G_ALLOCATOR_LIST: c_int = 1; +pub const G_ALLOCATOR_NODE: c_int = 3; +pub const G_ALLOCATOR_SLIST: c_int = 2; +pub const G_ALLOC_AND_FREE: c_int = 2; +pub const G_ALLOC_ONLY: c_int = 1; pub const G_ASCII_DTOSTR_BUF_SIZE: c_int = 39; pub const G_ATOMIC_REF_COUNT_INIT: c_int = 1; pub const G_BIG_ENDIAN: c_int = 4321; @@ -763,6 +801,7 @@ pub const G_TIME_SPAN_HOUR: i64 = 3600000000; pub const G_TIME_SPAN_MILLISECOND: i64 = 1000; pub const G_TIME_SPAN_MINUTE: i64 = 60000000; pub const G_TIME_SPAN_SECOND: i64 = 1000000; +pub const G_TRACE_CURRENT_TIME: c_int = 0; pub const G_UNICHAR_MAX_DECOMPOSITION_LENGTH: c_int = 18; pub const G_URI_RESERVED_CHARS_GENERIC_DELIMITERS: &[u8] = b":/?#[]@\0"; pub const G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: &[u8] = b"!$&'()*+,;=\0"; @@ -1089,11 +1128,17 @@ impl ::std::fmt::Debug for GVariantDict_u { } // Callbacks +pub type GCacheDestroyFunc = Option; +pub type GCacheDupFunc = Option gpointer>; +pub type GCacheNewFunc = Option gpointer>; pub type GChildWatchFunc = Option; pub type GClearHandleFunc = Option; pub type GCompareDataFunc = Option c_int>; pub type GCompareFunc = Option c_int>; +pub type GCompletionFunc = Option *mut c_char>; +pub type GCompletionStrncmpFunc = + Option c_int>; pub type GCopyFunc = Option gpointer>; pub type GDataForeachFunc = Option; pub type GDestroyNotify = Option; @@ -1166,6 +1211,14 @@ pub type GUnixFDSourceFunc = pub type GVoidFunc = Option; // Records +#[repr(C)] +pub struct _GAllocator { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GAllocator = _GAllocator; + #[derive(Copy, Clone)] #[repr(C)] pub struct GArray { @@ -1188,7 +1241,7 @@ pub struct _GAsyncQueue { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GAsyncQueue = *mut _GAsyncQueue; +pub type GAsyncQueue = _GAsyncQueue; #[repr(C)] pub struct GBookmarkFile { @@ -1231,6 +1284,14 @@ impl ::std::fmt::Debug for GBytes { } } +#[repr(C)] +pub struct _GCache { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GCache = _GCache; + #[repr(C)] pub struct GChecksum { _data: [u8; 0], @@ -1243,6 +1304,28 @@ impl ::std::fmt::Debug for GChecksum { } } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GCompletion { + pub items: *mut GList, + pub func: GCompletionFunc, + pub prefix: *mut c_char, + pub cache: *mut GList, + pub strncmp_func: GCompletionStrncmpFunc, +} + +impl ::std::fmt::Debug for GCompletion { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GCompletion @ {self:p}")) + .field("items", &self.items) + .field("func", &self.func) + .field("prefix", &self.prefix) + .field("cache", &self.cache) + .field("strncmp_func", &self.strncmp_func) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GCond { @@ -1262,7 +1345,7 @@ pub struct _GData { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GData = *mut _GData; +pub type GData = _GData; #[derive(Copy, Clone)] #[repr(C)] @@ -1309,12 +1392,16 @@ impl ::std::fmt::Debug for GDebugKey { } #[repr(C)] -pub struct _GDir { +pub struct GDir { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDir = *mut _GDir; +impl ::std::fmt::Debug for GDir { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GDir @ {self:p}")).finish() + } +} #[repr(C)] pub struct GDoubleIEEE754_mpn { @@ -1395,12 +1482,16 @@ impl ::std::fmt::Debug for GHashTableIter { } #[repr(C)] -pub struct _GHmac { +pub struct GHmac { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GHmac = *mut _GHmac; +impl ::std::fmt::Debug for GHmac { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GHmac @ {self:p}")).finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -1689,6 +1780,14 @@ impl ::std::fmt::Debug for GMatchInfo { } } +#[repr(C)] +pub struct _GMemChunk { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GMemChunk = _GMemChunk; + #[derive(Copy, Clone)] #[repr(C)] pub struct GMemVTable { @@ -1754,7 +1853,7 @@ pub struct _GOptionContext { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GOptionContext = *mut _GOptionContext; +pub type GOptionContext = _GOptionContext; #[derive(Copy, Clone)] #[repr(C)] @@ -1880,12 +1979,16 @@ impl ::std::fmt::Debug for GRWLock { } #[repr(C)] -pub struct _GRand { +pub struct GRand { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GRand = *mut _GRand; +impl ::std::fmt::Debug for GRand { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GRand @ {self:p}")).finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -1912,6 +2015,14 @@ impl ::std::fmt::Debug for GRegex { } } +#[repr(C)] +pub struct _GRelation { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GRelation = _GRelation; + #[derive(Copy, Clone)] #[repr(C)] pub struct GSList { @@ -2005,7 +2116,7 @@ pub struct _GSequence { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSequence = *mut _GSequence; +pub type GSequence = _GSequence; #[repr(C)] pub struct _GSequenceIter { @@ -2013,7 +2124,7 @@ pub struct _GSequenceIter { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSequenceIter = *mut _GSequenceIter; +pub type GSequenceIter = _GSequenceIter; #[derive(Copy, Clone)] #[repr(C)] @@ -2085,7 +2196,7 @@ pub struct _GSourcePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSourcePrivate = *mut _GSourcePrivate; +pub type GSourcePrivate = _GSourcePrivate; #[repr(C)] pub struct _GStatBuf { @@ -2093,7 +2204,67 @@ pub struct _GStatBuf { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GStatBuf = *mut _GStatBuf; +pub type GStatBuf = _GStatBuf; + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticMutex { + pub mutex: *mut GMutex, +} + +impl ::std::fmt::Debug for GStaticMutex { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticMutex @ {self:p}")) + .field("mutex", &self.mutex) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticPrivate { + pub index: c_uint, +} + +impl ::std::fmt::Debug for GStaticPrivate { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticPrivate @ {self:p}")) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticRWLock { + pub mutex: GStaticMutex, + pub read_cond: *mut GCond, + pub write_cond: *mut GCond, + pub read_counter: c_uint, + pub have_writer: gboolean, + pub want_to_read: c_uint, + pub want_to_write: c_uint, +} + +impl ::std::fmt::Debug for GStaticRWLock { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticRWLock @ {self:p}")) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticRecMutex { + pub mutex: GStaticMutex, + pub depth: c_uint, +} + +impl ::std::fmt::Debug for GStaticRecMutex { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticRecMutex @ {self:p}")) + .finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -2119,15 +2290,19 @@ pub struct _GStringChunk { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GStringChunk = *mut _GStringChunk; +pub type GStringChunk = _GStringChunk; #[repr(C)] -pub struct _GStrvBuilder { +pub struct GStrvBuilder { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GStrvBuilder = *mut _GStrvBuilder; +impl ::std::fmt::Debug for GStrvBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStrvBuilder @ {self:p}")).finish() + } +} #[repr(C)] pub struct _GTestCase { @@ -2135,7 +2310,7 @@ pub struct _GTestCase { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTestCase = *mut _GTestCase; +pub type GTestCase = _GTestCase; #[derive(Copy, Clone)] #[repr(C)] @@ -2181,12 +2356,15 @@ pub struct _GTestSuite { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTestSuite = *mut _GTestSuite; +pub type GTestSuite = _GTestSuite; +#[derive(Copy, Clone)] #[repr(C)] pub struct GThread { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, + pub func: GThreadFunc, + pub data: gpointer, + pub joinable: gboolean, + pub priority: GThreadPriority, } impl ::std::fmt::Debug for GThread { @@ -2195,6 +2373,72 @@ impl ::std::fmt::Debug for GThread { } } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GThreadFunctions { + pub mutex_new: Option *mut GMutex>, + pub mutex_lock: Option, + pub mutex_trylock: Option gboolean>, + pub mutex_unlock: Option, + pub mutex_free: Option, + pub cond_new: Option *mut GCond>, + pub cond_signal: Option, + pub cond_broadcast: Option, + pub cond_wait: Option, + pub cond_timed_wait: + Option gboolean>, + pub cond_free: Option, + pub private_new: Option *mut GPrivate>, + pub private_get: Option gpointer>, + pub private_set: Option, + pub thread_create: Option< + unsafe extern "C" fn( + GThreadFunc, + gpointer, + c_ulong, + gboolean, + gboolean, + GThreadPriority, + gpointer, + *mut *mut GError, + ), + >, + pub thread_yield: Option, + pub thread_join: Option, + pub thread_exit: Option, + pub thread_set_priority: Option, + pub thread_self: Option, + pub thread_equal: Option gboolean>, +} + +impl ::std::fmt::Debug for GThreadFunctions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GThreadFunctions @ {self:p}")) + .field("mutex_new", &self.mutex_new) + .field("mutex_lock", &self.mutex_lock) + .field("mutex_trylock", &self.mutex_trylock) + .field("mutex_unlock", &self.mutex_unlock) + .field("mutex_free", &self.mutex_free) + .field("cond_new", &self.cond_new) + .field("cond_signal", &self.cond_signal) + .field("cond_broadcast", &self.cond_broadcast) + .field("cond_wait", &self.cond_wait) + .field("cond_timed_wait", &self.cond_timed_wait) + .field("cond_free", &self.cond_free) + .field("private_new", &self.private_new) + .field("private_get", &self.private_get) + .field("private_set", &self.private_set) + .field("thread_create", &self.thread_create) + .field("thread_yield", &self.thread_yield) + .field("thread_join", &self.thread_join) + .field("thread_exit", &self.thread_exit) + .field("thread_set_priority", &self.thread_set_priority) + .field("thread_self", &self.thread_self) + .field("thread_equal", &self.thread_equal) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GThreadPool { @@ -2247,7 +2491,7 @@ pub struct _GTimer { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTimer = *mut _GTimer; +pub type GTimer = _GTimer; #[derive(Copy, Clone)] #[repr(C)] @@ -2281,7 +2525,39 @@ pub struct _GTreeNode { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTreeNode = *mut _GTreeNode; +pub type GTreeNode = _GTreeNode; + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GTuples { + pub len: c_uint, +} + +impl ::std::fmt::Debug for GTuples { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GTuples @ {self:p}")) + .field("len", &self.len) + .finish() + } +} + +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GUnixPipe { + pub fds: [c_int; 2], +} + +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] +impl ::std::fmt::Debug for GUnixPipe { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GUnixPipe @ {self:p}")) + .field("fds", &self.fds) + .finish() + } +} #[repr(C)] pub struct GUri { @@ -2415,6 +2691,28 @@ impl ::std::fmt::Debug for GVariantType { #[link(name = "glib-2.0")] extern "C" { + //========================================================================= + // GNormalizeMode + //========================================================================= + pub fn g_normalize_mode_get_type() -> GType; + + //========================================================================= + // GUnicodeBreakType + //========================================================================= + pub fn g_unicode_break_type_get_type() -> GType; + + //========================================================================= + // GUnicodeScript + //========================================================================= + pub fn g_unicode_script_get_type() -> GType; + pub fn g_unicode_script_from_iso15924(iso15924: u32) -> GUnicodeScript; + pub fn g_unicode_script_to_iso15924(script: GUnicodeScript) -> u32; + + //========================================================================= + // GUnicodeType + //========================================================================= + pub fn g_unicode_type_get_type() -> GType; + //========================================================================= // GIOCondition //========================================================================= @@ -2424,10 +2722,18 @@ extern "C" { // GMutex //========================================================================= pub fn g_mutex_clear(mutex: *mut GMutex); + pub fn g_mutex_free(mutex: *mut GMutex); pub fn g_mutex_init(mutex: *mut GMutex); pub fn g_mutex_lock(mutex: *mut GMutex); pub fn g_mutex_trylock(mutex: *mut GMutex) -> gboolean; pub fn g_mutex_unlock(mutex: *mut GMutex); + pub fn g_mutex_new() -> *mut GMutex; + + //========================================================================= + // GAllocator + //========================================================================= + pub fn g_allocator_free(allocator: *mut GAllocator); + pub fn g_allocator_new(name: *const c_char, n_preallocs: c_uint) -> *mut GAllocator; //========================================================================= // GArray @@ -2902,6 +3208,24 @@ extern "C" { pub fn g_bytes_unref_to_array(bytes: *mut GBytes) -> *mut GByteArray; pub fn g_bytes_unref_to_data(bytes: *mut GBytes, size: *mut size_t) -> gpointer; + //========================================================================= + // GCache + //========================================================================= + pub fn g_cache_destroy(cache: *mut GCache); + pub fn g_cache_insert(cache: *mut GCache, key: gpointer) -> gpointer; + pub fn g_cache_key_foreach(cache: *mut GCache, func: GHFunc, user_data: gpointer); + pub fn g_cache_remove(cache: *mut GCache, value: gconstpointer); + pub fn g_cache_value_foreach(cache: *mut GCache, func: GHFunc, user_data: gpointer); + pub fn g_cache_new( + value_new_func: GCacheNewFunc, + value_destroy_func: GCacheDestroyFunc, + key_dup_func: GCacheDupFunc, + key_destroy_func: GCacheDestroyFunc, + hash_key_func: GHashFunc, + hash_value_func: GHashFunc, + key_equal_func: GEqualFunc, + ) -> *mut GCache; + //========================================================================= // GChecksum //========================================================================= @@ -2919,15 +3243,42 @@ extern "C" { pub fn g_checksum_update(checksum: *mut GChecksum, data: *const u8, length: ssize_t); pub fn g_checksum_type_get_length(checksum_type: GChecksumType) -> ssize_t; + //========================================================================= + // GCompletion + //========================================================================= + pub fn g_completion_add_items(cmp: *mut GCompletion, items: *mut GList); + pub fn g_completion_clear_items(cmp: *mut GCompletion); + pub fn g_completion_complete( + cmp: *mut GCompletion, + prefix: *const c_char, + new_prefix: *mut *mut c_char, + ) -> *mut GList; + pub fn g_completion_complete_utf8( + cmp: *mut GCompletion, + prefix: *const c_char, + new_prefix: *mut *mut c_char, + ) -> *mut GList; + pub fn g_completion_free(cmp: *mut GCompletion); + pub fn g_completion_remove_items(cmp: *mut GCompletion, items: *mut GList); + pub fn g_completion_set_compare(cmp: *mut GCompletion, strncmp_func: GCompletionStrncmpFunc); + pub fn g_completion_new(func: GCompletionFunc) -> *mut GCompletion; + //========================================================================= // GCond //========================================================================= pub fn g_cond_broadcast(cond: *mut GCond); pub fn g_cond_clear(cond: *mut GCond); + pub fn g_cond_free(cond: *mut GCond); pub fn g_cond_init(cond: *mut GCond); pub fn g_cond_signal(cond: *mut GCond); + pub fn g_cond_timed_wait( + cond: *mut GCond, + mutex: *mut GMutex, + abs_time: *mut GTimeVal, + ) -> gboolean; pub fn g_cond_wait(cond: *mut GCond, mutex: *mut GMutex); pub fn g_cond_wait_until(cond: *mut GCond, mutex: *mut GMutex, end_time: i64) -> gboolean; + pub fn g_cond_new() -> *mut GCond; //========================================================================= // GDate @@ -3008,7 +3359,13 @@ extern "C" { pub fn g_date_time_new_from_timeval_local(tv: *const GTimeVal) -> *mut GDateTime; pub fn g_date_time_new_from_timeval_utc(tv: *const GTimeVal) -> *mut GDateTime; pub fn g_date_time_new_from_unix_local(t: i64) -> *mut GDateTime; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_date_time_new_from_unix_local_usec(usecs: i64) -> *mut GDateTime; pub fn g_date_time_new_from_unix_utc(t: i64) -> *mut GDateTime; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_date_time_new_from_unix_utc_usec(usecs: i64) -> *mut GDateTime; pub fn g_date_time_new_local( year: c_int, month: c_int, @@ -3082,17 +3439,27 @@ extern "C" { pub fn g_date_time_to_timeval(datetime: *mut GDateTime, tv: *mut GTimeVal) -> gboolean; pub fn g_date_time_to_timezone(datetime: *mut GDateTime, tz: *mut GTimeZone) -> *mut GDateTime; pub fn g_date_time_to_unix(datetime: *mut GDateTime) -> i64; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_date_time_to_unix_usec(datetime: *mut GDateTime) -> i64; pub fn g_date_time_to_utc(datetime: *mut GDateTime) -> *mut GDateTime; pub fn g_date_time_unref(datetime: *mut GDateTime); //========================================================================= // GDir //========================================================================= + pub fn g_dir_get_type() -> GType; + pub fn g_dir_open(path: *const c_char, flags: c_uint, error: *mut *mut GError) -> *mut GDir; pub fn g_dir_close(dir: *mut GDir); pub fn g_dir_read_name(dir: *mut GDir) -> *const c_char; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_dir_ref(dir: *mut GDir) -> *mut GDir; pub fn g_dir_rewind(dir: *mut GDir); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_dir_unref(dir: *mut GDir); pub fn g_dir_make_tmp(tmpl: *const c_char, error: *mut *mut GError) -> *mut c_char; - pub fn g_dir_open(path: *const c_char, flags: c_uint, error: *mut *mut GError) -> *mut GDir; //========================================================================= // GError @@ -3224,13 +3591,14 @@ extern "C" { //========================================================================= // GHmac //========================================================================= + pub fn g_hmac_get_type() -> GType; + pub fn g_hmac_new(digest_type: GChecksumType, key: *const u8, key_len: size_t) -> *mut GHmac; pub fn g_hmac_copy(hmac: *const GHmac) -> *mut GHmac; pub fn g_hmac_get_digest(hmac: *mut GHmac, buffer: *mut u8, digest_len: *mut size_t); pub fn g_hmac_get_string(hmac: *mut GHmac) -> *const c_char; pub fn g_hmac_ref(hmac: *mut GHmac) -> *mut GHmac; pub fn g_hmac_unref(hmac: *mut GHmac); pub fn g_hmac_update(hmac: *mut GHmac, data: *const u8, length: ssize_t); - pub fn g_hmac_new(digest_type: GChecksumType, key: *const u8, key_len: size_t) -> *mut GHmac; //========================================================================= // GHook @@ -3742,8 +4110,10 @@ extern "C" { pub fn g_list_nth(list: *mut GList, n: c_uint) -> *mut GList; pub fn g_list_nth_data(list: *mut GList, n: c_uint) -> gpointer; pub fn g_list_nth_prev(list: *mut GList, n: c_uint) -> *mut GList; + pub fn g_list_pop_allocator(); pub fn g_list_position(list: *mut GList, llink: *mut GList) -> c_int; pub fn g_list_prepend(list: *mut GList, data: gpointer) -> *mut GList; + pub fn g_list_push_allocator(allocator: *mut GAllocator); pub fn g_list_remove(list: *mut GList, data: gconstpointer) -> *mut GList; pub fn g_list_remove_all(list: *mut GList, data: gconstpointer) -> *mut GList; pub fn g_list_remove_link(list: *mut GList, llink: *mut GList) -> *mut GList; @@ -3934,6 +4304,24 @@ extern "C" { pub fn g_match_info_ref(match_info: *mut GMatchInfo) -> *mut GMatchInfo; pub fn g_match_info_unref(match_info: *mut GMatchInfo); + //========================================================================= + // GMemChunk + //========================================================================= + pub fn g_mem_chunk_alloc(mem_chunk: *mut GMemChunk) -> gpointer; + pub fn g_mem_chunk_alloc0(mem_chunk: *mut GMemChunk) -> gpointer; + pub fn g_mem_chunk_clean(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_destroy(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_free(mem_chunk: *mut GMemChunk, mem: gpointer); + pub fn g_mem_chunk_print(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_reset(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_info(); + pub fn g_mem_chunk_new( + name: *const c_char, + atom_size: c_int, + area_size: size_t, + type_: c_int, + ) -> *mut GMemChunk; + //========================================================================= // GNode //========================================================================= @@ -3989,13 +4377,22 @@ extern "C" { ); pub fn g_node_unlink(node: *mut GNode); pub fn g_node_new(data: gpointer) -> *mut GNode; + pub fn g_node_pop_allocator(); + pub fn g_node_push_allocator(allocator: *mut GAllocator); //========================================================================= // GOnce //========================================================================= pub fn g_once_impl(once: *mut GOnce, func: GThreadFunc, arg: gpointer) -> gpointer; pub fn g_once_init_enter(location: *mut c_void) -> gboolean; + pub fn g_once_init_enter_impl(location: *mut size_t) -> gboolean; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_once_init_enter_pointer(location: *mut c_void) -> gboolean; pub fn g_once_init_leave(location: *mut c_void, result: size_t); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_once_init_leave_pointer(location: *mut c_void, result: gpointer); //========================================================================= // GOptionContext @@ -4165,6 +4562,7 @@ extern "C" { pub fn g_private_get(key: *mut GPrivate) -> gpointer; pub fn g_private_replace(key: *mut GPrivate, value: gpointer); pub fn g_private_set(key: *mut GPrivate, value: gpointer); + pub fn g_private_new(notify: GDestroyNotify) -> *mut GPrivate; //========================================================================= // GPtrArray @@ -4366,6 +4764,10 @@ extern "C" { //========================================================================= // GRand //========================================================================= + pub fn g_rand_get_type() -> GType; + pub fn g_rand_new() -> *mut GRand; + pub fn g_rand_new_with_seed(seed: u32) -> *mut GRand; + pub fn g_rand_new_with_seed_array(seed: *const u32, seed_length: c_uint) -> *mut GRand; pub fn g_rand_copy(rand_: *mut GRand) -> *mut GRand; pub fn g_rand_double(rand_: *mut GRand) -> c_double; pub fn g_rand_double_range(rand_: *mut GRand, begin: c_double, end: c_double) -> c_double; @@ -4374,9 +4776,6 @@ extern "C" { pub fn g_rand_int_range(rand_: *mut GRand, begin: i32, end: i32) -> i32; pub fn g_rand_set_seed(rand_: *mut GRand, seed: u32); pub fn g_rand_set_seed_array(rand_: *mut GRand, seed: *const u32, seed_length: c_uint); - pub fn g_rand_new() -> *mut GRand; - pub fn g_rand_new_with_seed(seed: u32) -> *mut GRand; - pub fn g_rand_new_with_seed_array(seed: *const u32, seed_length: c_uint) -> *mut GRand; //========================================================================= // GRecMutex @@ -4500,6 +4899,28 @@ extern "C" { match_options: GRegexMatchFlags, ) -> *mut *mut c_char; + //========================================================================= + // GRelation + //========================================================================= + pub fn g_relation_count(relation: *mut GRelation, key: gconstpointer, field: c_int) -> c_int; + pub fn g_relation_delete(relation: *mut GRelation, key: gconstpointer, field: c_int) -> c_int; + pub fn g_relation_destroy(relation: *mut GRelation); + pub fn g_relation_exists(relation: *mut GRelation, ...) -> gboolean; + pub fn g_relation_index( + relation: *mut GRelation, + field: c_int, + hash_func: GHashFunc, + key_equal_func: GEqualFunc, + ); + pub fn g_relation_insert(relation: *mut GRelation, ...); + pub fn g_relation_print(relation: *mut GRelation); + pub fn g_relation_select( + relation: *mut GRelation, + key: gconstpointer, + field: c_int, + ) -> *mut GTuples; + pub fn g_relation_new(fields: c_int) -> *mut GRelation; + //========================================================================= // GSList //========================================================================= @@ -4545,8 +4966,10 @@ extern "C" { pub fn g_slist_length(list: *mut GSList) -> c_uint; pub fn g_slist_nth(list: *mut GSList, n: c_uint) -> *mut GSList; pub fn g_slist_nth_data(list: *mut GSList, n: c_uint) -> gpointer; + pub fn g_slist_pop_allocator(); pub fn g_slist_position(list: *mut GSList, llink: *mut GSList) -> c_int; pub fn g_slist_prepend(list: *mut GSList, data: gpointer) -> *mut GSList; + pub fn g_slist_push_allocator(allocator: *mut GAllocator); pub fn g_slist_remove(list: *mut GSList, data: gconstpointer) -> *mut GSList; pub fn g_slist_remove_all(list: *mut GSList, data: gconstpointer) -> *mut GSList; pub fn g_slist_remove_link(list: *mut GSList, link_: *mut GSList) -> *mut GSList; @@ -4766,6 +5189,48 @@ extern "C" { pub fn g_source_remove_by_user_data(user_data: gpointer) -> gboolean; pub fn g_source_set_name_by_id(tag: c_uint, name: *const c_char); + //========================================================================= + // GStaticMutex + //========================================================================= + pub fn g_static_mutex_free(mutex: *mut GStaticMutex); + pub fn g_static_mutex_get_mutex_impl(mutex: *mut GStaticMutex) -> *mut GMutex; + pub fn g_static_mutex_init(mutex: *mut GStaticMutex); + + //========================================================================= + // GStaticPrivate + //========================================================================= + pub fn g_static_private_free(private_key: *mut GStaticPrivate); + pub fn g_static_private_get(private_key: *mut GStaticPrivate) -> gpointer; + pub fn g_static_private_init(private_key: *mut GStaticPrivate); + pub fn g_static_private_set( + private_key: *mut GStaticPrivate, + data: gpointer, + notify: GDestroyNotify, + ); + + //========================================================================= + // GStaticRWLock + //========================================================================= + pub fn g_static_rw_lock_free(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_init(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_reader_lock(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_reader_trylock(lock: *mut GStaticRWLock) -> gboolean; + pub fn g_static_rw_lock_reader_unlock(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_writer_lock(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_writer_trylock(lock: *mut GStaticRWLock) -> gboolean; + pub fn g_static_rw_lock_writer_unlock(lock: *mut GStaticRWLock); + + //========================================================================= + // GStaticRecMutex + //========================================================================= + pub fn g_static_rec_mutex_free(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_init(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_lock(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_lock_full(mutex: *mut GStaticRecMutex, depth: c_uint); + pub fn g_static_rec_mutex_trylock(mutex: *mut GStaticRecMutex) -> gboolean; + pub fn g_static_rec_mutex_unlock(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_unlock_full(mutex: *mut GStaticRecMutex) -> c_uint; + //========================================================================= // GString //========================================================================= @@ -4868,6 +5333,12 @@ extern "C" { //========================================================================= #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] + pub fn g_strv_builder_get_type() -> GType; + #[cfg(feature = "v2_68")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] + pub fn g_strv_builder_new() -> *mut GStrvBuilder; + #[cfg(feature = "v2_68")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_strv_builder_add(builder: *mut GStrvBuilder, value: *const c_char); #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] @@ -4883,10 +5354,10 @@ extern "C" { pub fn g_strv_builder_ref(builder: *mut GStrvBuilder) -> *mut GStrvBuilder; #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] - pub fn g_strv_builder_unref(builder: *mut GStrvBuilder); + pub fn g_strv_builder_take(builder: *mut GStrvBuilder, value: *mut c_char); #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] - pub fn g_strv_builder_new() -> *mut GStrvBuilder; + pub fn g_strv_builder_unref(builder: *mut GStrvBuilder); //========================================================================= // GTestCase @@ -4930,9 +5401,29 @@ extern "C" { ) -> *mut GThread; pub fn g_thread_join(thread: *mut GThread) -> gpointer; pub fn g_thread_ref(thread: *mut GThread) -> *mut GThread; + pub fn g_thread_set_priority(thread: *mut GThread, priority: GThreadPriority); pub fn g_thread_unref(thread: *mut GThread); + pub fn g_thread_create( + func: GThreadFunc, + data: gpointer, + joinable: gboolean, + error: *mut *mut GError, + ) -> *mut GThread; + pub fn g_thread_create_full( + func: GThreadFunc, + data: gpointer, + stack_size: c_ulong, + joinable: gboolean, + bound: gboolean, + priority: GThreadPriority, + error: *mut *mut GError, + ) -> *mut GThread; pub fn g_thread_error_quark() -> GQuark; pub fn g_thread_exit(retval: gpointer); + pub fn g_thread_foreach(thread_func: GFunc, user_data: gpointer); + pub fn g_thread_get_initialized() -> gboolean; + pub fn g_thread_init(vtable: gpointer); + pub fn g_thread_init_with_errorcheck_mutexes(vtable: gpointer); pub fn g_thread_self() -> *mut GThread; pub fn g_thread_yield(); @@ -5130,6 +5621,12 @@ extern "C" { #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_tree_node_value(node: *mut GTreeNode) -> gpointer; + //========================================================================= + // GTuples + //========================================================================= + pub fn g_tuples_destroy(tuples: *mut GTuples); + pub fn g_tuples_index(tuples: *mut GTuples, index_: c_int, field: c_int) -> gpointer; + //========================================================================= // GUri //========================================================================= @@ -5644,7 +6141,7 @@ extern "C" { pub fn g_variant_type_next(type_: *const GVariantType) -> *const GVariantType; pub fn g_variant_type_peek_string(type_: *const GVariantType) -> *const c_char; pub fn g_variant_type_value(type_: *const GVariantType) -> *const GVariantType; - pub fn g_variant_type_checked_(arg0: *const c_char) -> *const GVariantType; + pub fn g_variant_type_checked_(type_string: *const c_char) -> *const GVariantType; pub fn g_variant_type_string_get_depth_(type_string: *const c_char) -> size_t; pub fn g_variant_type_string_is_valid(type_string: *const c_char) -> gboolean; pub fn g_variant_type_string_scan( @@ -5795,8 +6292,8 @@ extern "C" { pub fn g_atomic_int_or(atomic: *mut c_uint, val: c_uint) -> c_uint; pub fn g_atomic_int_set(atomic: *mut c_int, newval: c_int); pub fn g_atomic_int_xor(atomic: *mut c_uint, val: c_uint) -> c_uint; - pub fn g_atomic_pointer_add(atomic: *mut c_void, val: ssize_t) -> ssize_t; - pub fn g_atomic_pointer_and(atomic: *mut c_void, val: size_t) -> size_t; + pub fn g_atomic_pointer_add(atomic: *mut c_void, val: ssize_t) -> intptr_t; + pub fn g_atomic_pointer_and(atomic: *mut c_void, val: size_t) -> uintptr_t; pub fn g_atomic_pointer_compare_and_exchange( atomic: *mut c_void, oldval: gpointer, @@ -5814,9 +6311,9 @@ extern "C" { #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))] pub fn g_atomic_pointer_exchange(atomic: *mut c_void, newval: gpointer) -> gpointer; pub fn g_atomic_pointer_get(atomic: *mut c_void) -> gpointer; - pub fn g_atomic_pointer_or(atomic: *mut c_void, val: size_t) -> size_t; + pub fn g_atomic_pointer_or(atomic: *mut c_void, val: size_t) -> uintptr_t; pub fn g_atomic_pointer_set(atomic: *mut c_void, newval: gpointer); - pub fn g_atomic_pointer_xor(atomic: *mut c_void, val: size_t) -> size_t; + pub fn g_atomic_pointer_xor(atomic: *mut c_void, val: size_t) -> uintptr_t; #[cfg(feature = "v2_58")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))] pub fn g_atomic_rc_box_acquire(mem_block: gpointer) -> gpointer; @@ -6299,6 +6796,9 @@ extern "C" { n_fields: size_t, user_data: gpointer, ) -> GLogWriterOutput; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_log_writer_default_set_debug_domains(domains: *const *const c_char); #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_log_writer_default_set_use_stderr(use_stderr: gboolean); @@ -6328,6 +6828,14 @@ extern "C" { user_data: gpointer, ) -> GLogWriterOutput; pub fn g_log_writer_supports_color(output_fd: c_int) -> gboolean; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_log_writer_syslog( + log_level: GLogLevelFlags, + fields: *const GLogField, + n_fields: size_t, + user_data: gpointer, + ) -> GLogWriterOutput; //pub fn g_logv(log_domain: *const c_char, log_level: GLogLevelFlags, format: *const c_char, args: /*Unimplemented*/va_list); pub fn g_main_current_source() -> *mut GSource; pub fn g_main_depth() -> c_int; @@ -6383,8 +6891,28 @@ extern "C" { pub fn g_pattern_match_simple(pattern: *const c_char, string: *const c_char) -> gboolean; pub fn g_pattern_match_string(pspec: *mut GPatternSpec, string: *const c_char) -> gboolean; pub fn g_pointer_bit_lock(address: *mut c_void, lock_bit: c_int); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_pointer_bit_lock_and_get(address: gpointer, lock_bit: c_uint, out_ptr: *mut uintptr_t); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_pointer_bit_lock_mask_ptr( + ptr: gpointer, + lock_bit: c_uint, + set: gboolean, + preserve_mask: uintptr_t, + preserve_ptr: gpointer, + ) -> gpointer; pub fn g_pointer_bit_trylock(address: *mut c_void, lock_bit: c_int) -> gboolean; pub fn g_pointer_bit_unlock(address: *mut c_void, lock_bit: c_int); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_pointer_bit_unlock_and_set( + address: *mut c_void, + lock_bit: c_uint, + ptr: gpointer, + preserve_mask: uintptr_t, + ); pub fn g_poll(fds: *mut GPollFD, nfds: c_uint, timeout: c_int) -> c_int; pub fn g_prefix_error(err: *mut *mut GError, format: *const c_char, ...); #[cfg(feature = "v2_70")] @@ -6494,6 +7022,7 @@ extern "C" { pub fn g_set_prgname(prgname: *const c_char); pub fn g_set_print_handler(func: GPrintFunc) -> GPrintFunc; pub fn g_set_printerr_handler(func: GPrintFunc) -> GPrintFunc; + pub fn g_set_user_dirs(first_dir_type: *const c_char, ...); pub fn g_setenv(variable: *const c_char, value: *const c_char, overwrite: gboolean) -> gboolean; pub fn g_shell_error_quark() -> GQuark; @@ -6613,6 +7142,7 @@ extern "C" { error: *mut *mut GError, ) -> gboolean; pub fn g_sprintf(string: *mut c_char, format: *const c_char, ...) -> c_int; + pub fn g_stat(filename: *const c_char, buf: *mut GStatBuf) -> c_int; pub fn g_stpcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char; pub fn g_str_equal(v1: gconstpointer, v2: gconstpointer) -> gboolean; pub fn g_str_has_prefix(str: *const c_char, prefix: *const c_char) -> gboolean; @@ -6804,6 +7334,14 @@ extern "C" { usec_timeout: u64, test_flags: GTestSubprocessFlags, ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_test_trap_subprocess_with_envp( + test_path: *const c_char, + envp: *const *const c_char, + usec_timeout: u64, + test_flags: GTestSubprocessFlags, + ); pub fn g_timeout_add(interval: c_uint, function: GSourceFunc, data: gpointer) -> c_uint; pub fn g_timeout_add_full( priority: c_int, @@ -6896,8 +7434,6 @@ extern "C" { pub fn g_unichar_xdigit_value(c: u32) -> c_int; pub fn g_unicode_canonical_decomposition(ch: u32, result_len: *mut size_t) -> *mut u32; pub fn g_unicode_canonical_ordering(string: *mut u32, len: size_t); - pub fn g_unicode_script_from_iso15924(iso15924: u32) -> GUnicodeScript; - pub fn g_unicode_script_to_iso15924(script: GUnicodeScript) -> u32; pub fn g_unix_error_quark() -> GQuark; pub fn g_unix_fd_add( fd: c_int, @@ -7024,5 +7560,47 @@ extern "C" { func: *const c_char, warnexpr: *const c_char, ); + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_check_windows_version( + major: c_int, + minor: c_int, + spver: c_int, + os_type: GWin32OSType, + ) -> gboolean; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_error_message(error: c_int) -> *mut c_char; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_ftruncate(f: c_int, size: c_uint) -> c_int; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_get_command_line() -> *mut *mut c_char; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_get_package_installation_directory( + package: *const c_char, + dll_name: *const c_char, + ) -> *mut c_char; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_get_package_installation_directory_of_module(hmodule: gpointer) -> *mut c_char; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_get_package_installation_subdirectory( + package: *const c_char, + dll_name: *const c_char, + subdir: *const c_char, + ) -> *mut c_char; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_get_windows_version() -> c_uint; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_getlocale() -> *mut c_char; + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + pub fn g_win32_locale_filename_from_utf8(utf8filename: *const c_char) -> *mut c_char; } diff --git a/glib/sys/src/manual.rs b/glib/sys/src/manual.rs index 47f334f9c85b..065decd4c0b0 100644 --- a/glib/sys/src/manual.rs +++ b/glib/sys/src/manual.rs @@ -5,6 +5,8 @@ pub use libc::passwd; #[allow(unused_imports)] use libc::{c_char, c_int, c_ushort, c_void}; +pub type GType = libc::size_t; + #[cfg(all(not(unix), docsrs))] #[repr(C)] pub struct passwd { @@ -41,42 +43,6 @@ pub struct GPollFD { pub revents: c_ushort, } -#[cfg(target_family = "windows")] -pub use self::win32::*; - -#[cfg(target_family = "windows")] -mod win32 { - use libc::{c_char, c_int}; - - use crate::gboolean; - - pub type GWin32OSType = c_int; - pub const G_WIN32_OS_ANY: GWin32OSType = 0; - pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; - pub const G_WIN32_OS_SERVER: GWin32OSType = 2; - - extern "C" { - pub fn g_win32_check_windows_version( - major: c_int, - minor: c_int, - spver: c_int, - os_type: GWin32OSType, - ) -> gboolean; - - pub fn g_win32_get_command_line() -> *mut *mut c_char; - - pub fn g_win32_error_message(error: c_int) -> *mut c_char; - - pub fn g_win32_getlocale() -> *mut c_char; - - pub fn g_win32_get_package_installation_directory_of_module( - hmodule: std::os::windows::raw::HANDLE, - ) -> *mut c_char; - - pub fn g_win32_locale_filename_from_utf8(utf8filename: *const c_char) -> *mut c_char; - } -} - // These are all non-NUL terminated strings in C pub const G_VARIANT_TYPE_BOOLEAN: &str = "b"; pub const G_VARIANT_TYPE_BYTE: &str = "y"; diff --git a/glib/sys/tests/abi.rs b/glib/sys/tests/abi.rs index a33ffcb849fe..dd0c95c68f81 100644 --- a/glib/sys/tests/abi.rs +++ b/glib/sys/tests/abi.rs @@ -236,6 +236,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GCompletion", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GCond", Layout { @@ -726,6 +733,34 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GStaticMutex", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GStaticPrivate", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GStaticRWLock", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GStaticRecMutex", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GString", Layout { @@ -789,6 +824,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThread", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GThreadError", Layout { @@ -796,6 +838,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThreadFunctions", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GThreadPool", Layout { @@ -803,6 +852,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThreadPriority", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GTime", Layout { @@ -867,10 +923,10 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ }, ), ( - "GType", + "GTuples", Layout { - size: size_of::(), - alignment: align_of::(), + size: size_of::(), + alignment: align_of::(), }, ), ( @@ -894,6 +950,24 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + #[cfg(unix)] + #[cfg_attr(docsrs, doc(cfg(unix)))] + ( + "GUnixPipe", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + #[cfg(unix)] + #[cfg_attr(docsrs, doc(cfg(unix)))] + ( + "GUnixPipeEnd", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GUriError", Layout { @@ -971,6 +1045,15 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] + ( + "GWin32OSType", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ @@ -980,6 +1063,11 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("GLIB_SYSDEF_MSG_DONTROUTE", "4"), ("GLIB_SYSDEF_MSG_OOB", "1"), ("GLIB_SYSDEF_MSG_PEEK", "2"), + ("G_ALLOCATOR_LIST", "1"), + ("G_ALLOCATOR_NODE", "3"), + ("G_ALLOCATOR_SLIST", "2"), + ("G_ALLOC_AND_FREE", "2"), + ("G_ALLOC_ONLY", "1"), ("(guint) G_ASCII_ALNUM", "1"), ("(guint) G_ASCII_ALPHA", "2"), ("(guint) G_ASCII_CNTRL", "4"), @@ -1450,6 +1538,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_TEST_TRAP_SILENCE_STDERR", "256"), ("(guint) G_TEST_TRAP_SILENCE_STDOUT", "128"), ("(gint) G_THREAD_ERROR_AGAIN", "0"), + ("(gint) G_THREAD_PRIORITY_HIGH", "2"), + ("(gint) G_THREAD_PRIORITY_LOW", "0"), + ("(gint) G_THREAD_PRIORITY_NORMAL", "1"), + ("(gint) G_THREAD_PRIORITY_URGENT", "3"), ("G_TIME_SPAN_DAY", "86400000000"), ("G_TIME_SPAN_HOUR", "3600000000"), ("G_TIME_SPAN_MILLISECOND", "1000"), @@ -1481,6 +1573,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_TOKEN_RIGHT_PAREN", "41"), ("(gint) G_TOKEN_STRING", "264"), ("(gint) G_TOKEN_SYMBOL", "265"), + ("G_TRACE_CURRENT_TIME", "0"), ("(guint) G_TRAVERSE_ALL", "3"), ("(guint) G_TRAVERSE_LEAFS", "1"), ("(guint) G_TRAVERSE_LEAVES", "1"), @@ -1489,6 +1582,9 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_TRAVERSE_NON_LEAVES", "2"), ("G_UNICHAR_MAX_DECOMPOSITION_LENGTH", "18"), ("(gint) G_UNICODE_BREAK_AFTER", "10"), + ("(gint) G_UNICODE_BREAK_AKSARA", "43"), + ("(gint) G_UNICODE_BREAK_AKSARA_PRE_BASE", "44"), + ("(gint) G_UNICODE_BREAK_AKSARA_START", "45"), ("(gint) G_UNICODE_BREAK_ALPHABETIC", "23"), ("(gint) G_UNICODE_BREAK_AMBIGUOUS", "27"), ("(gint) G_UNICODE_BREAK_BEFORE", "11"), @@ -1529,6 +1625,8 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_UNICODE_BREAK_SURROGATE", "4"), ("(gint) G_UNICODE_BREAK_SYMBOL", "22"), ("(gint) G_UNICODE_BREAK_UNKNOWN", "28"), + ("(gint) G_UNICODE_BREAK_VIRAMA", "47"), + ("(gint) G_UNICODE_BREAK_VIRAMA_FINAL", "46"), ("(gint) G_UNICODE_BREAK_WORD_JOINER", "30"), ("(gint) G_UNICODE_BREAK_ZERO_WIDTH_JOINER", "42"), ("(gint) G_UNICODE_BREAK_ZERO_WIDTH_SPACE", "5"), @@ -1728,6 +1826,8 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_UNICODE_TITLECASE_LETTER", "8"), ("(gint) G_UNICODE_UNASSIGNED", "2"), ("(gint) G_UNICODE_UPPERCASE_LETTER", "9"), + ("(gint) G_UNIX_PIPE_END_READ", "0"), + ("(gint) G_UNIX_PIPE_END_WRITE", "1"), ("(gint) G_URI_ERROR_BAD_AUTH_PARAMS", "4"), ("(gint) G_URI_ERROR_BAD_FRAGMENT", "9"), ("(gint) G_URI_ERROR_BAD_HOST", "5"), @@ -1814,4 +1914,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ), ("(gint) G_VARIANT_PARSE_ERROR_VALUE_EXPECTED", "17"), ("G_WIN32_MSG_HANDLE", "19981206"), + ("(gint) G_WIN32_OS_ANY", "0"), + ("(gint) G_WIN32_OS_SERVER", "2"), + ("(gint) G_WIN32_OS_WORKSTATION", "1"), ]; diff --git a/glib/sys/tests/constant.c b/glib/sys/tests/constant.c index c3acfe696347..745ba8bf5e7f 100644 --- a/glib/sys/tests/constant.c +++ b/glib/sys/tests/constant.c @@ -34,6 +34,11 @@ int main() { PRINT_CONSTANT(GLIB_SYSDEF_MSG_DONTROUTE); PRINT_CONSTANT(GLIB_SYSDEF_MSG_OOB); PRINT_CONSTANT(GLIB_SYSDEF_MSG_PEEK); + PRINT_CONSTANT(G_ALLOCATOR_LIST); + PRINT_CONSTANT(G_ALLOCATOR_NODE); + PRINT_CONSTANT(G_ALLOCATOR_SLIST); + PRINT_CONSTANT(G_ALLOC_AND_FREE); + PRINT_CONSTANT(G_ALLOC_ONLY); PRINT_CONSTANT((guint) G_ASCII_ALNUM); PRINT_CONSTANT((guint) G_ASCII_ALPHA); PRINT_CONSTANT((guint) G_ASCII_CNTRL); @@ -477,6 +482,10 @@ int main() { PRINT_CONSTANT((guint) G_TEST_TRAP_SILENCE_STDERR); PRINT_CONSTANT((guint) G_TEST_TRAP_SILENCE_STDOUT); PRINT_CONSTANT((gint) G_THREAD_ERROR_AGAIN); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_HIGH); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_LOW); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_NORMAL); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_URGENT); PRINT_CONSTANT(G_TIME_SPAN_DAY); PRINT_CONSTANT(G_TIME_SPAN_HOUR); PRINT_CONSTANT(G_TIME_SPAN_MILLISECOND); @@ -508,6 +517,7 @@ int main() { PRINT_CONSTANT((gint) G_TOKEN_RIGHT_PAREN); PRINT_CONSTANT((gint) G_TOKEN_STRING); PRINT_CONSTANT((gint) G_TOKEN_SYMBOL); + PRINT_CONSTANT(G_TRACE_CURRENT_TIME); PRINT_CONSTANT((guint) G_TRAVERSE_ALL); PRINT_CONSTANT((guint) G_TRAVERSE_LEAFS); PRINT_CONSTANT((guint) G_TRAVERSE_LEAVES); @@ -516,6 +526,9 @@ int main() { PRINT_CONSTANT((guint) G_TRAVERSE_NON_LEAVES); PRINT_CONSTANT(G_UNICHAR_MAX_DECOMPOSITION_LENGTH); PRINT_CONSTANT((gint) G_UNICODE_BREAK_AFTER); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_AKSARA); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_AKSARA_PRE_BASE); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_AKSARA_START); PRINT_CONSTANT((gint) G_UNICODE_BREAK_ALPHABETIC); PRINT_CONSTANT((gint) G_UNICODE_BREAK_AMBIGUOUS); PRINT_CONSTANT((gint) G_UNICODE_BREAK_BEFORE); @@ -556,6 +569,8 @@ int main() { PRINT_CONSTANT((gint) G_UNICODE_BREAK_SURROGATE); PRINT_CONSTANT((gint) G_UNICODE_BREAK_SYMBOL); PRINT_CONSTANT((gint) G_UNICODE_BREAK_UNKNOWN); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_VIRAMA); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_VIRAMA_FINAL); PRINT_CONSTANT((gint) G_UNICODE_BREAK_WORD_JOINER); PRINT_CONSTANT((gint) G_UNICODE_BREAK_ZERO_WIDTH_JOINER); PRINT_CONSTANT((gint) G_UNICODE_BREAK_ZERO_WIDTH_SPACE); @@ -755,6 +770,8 @@ int main() { PRINT_CONSTANT((gint) G_UNICODE_TITLECASE_LETTER); PRINT_CONSTANT((gint) G_UNICODE_UNASSIGNED); PRINT_CONSTANT((gint) G_UNICODE_UPPERCASE_LETTER); + PRINT_CONSTANT((gint) G_UNIX_PIPE_END_READ); + PRINT_CONSTANT((gint) G_UNIX_PIPE_END_WRITE); PRINT_CONSTANT((gint) G_URI_ERROR_BAD_AUTH_PARAMS); PRINT_CONSTANT((gint) G_URI_ERROR_BAD_FRAGMENT); PRINT_CONSTANT((gint) G_URI_ERROR_BAD_HOST); @@ -835,5 +852,8 @@ int main() { PRINT_CONSTANT((gint) G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT); PRINT_CONSTANT((gint) G_VARIANT_PARSE_ERROR_VALUE_EXPECTED); PRINT_CONSTANT(G_WIN32_MSG_HANDLE); + PRINT_CONSTANT((gint) G_WIN32_OS_ANY); + PRINT_CONSTANT((gint) G_WIN32_OS_SERVER); + PRINT_CONSTANT((gint) G_WIN32_OS_WORKSTATION); return 0; } diff --git a/glib/sys/tests/layout.c b/glib/sys/tests/layout.c index 4b8a1f97ec06..693d0e1749bb 100644 --- a/glib/sys/tests/layout.c +++ b/glib/sys/tests/layout.c @@ -12,6 +12,7 @@ int main() { printf("%s;%zu;%zu\n", "GBookmarkFileError", sizeof(GBookmarkFileError), alignof(GBookmarkFileError)); printf("%s;%zu;%zu\n", "GByteArray", sizeof(GByteArray), alignof(GByteArray)); printf("%s;%zu;%zu\n", "GChecksumType", sizeof(GChecksumType), alignof(GChecksumType)); + printf("%s;%zu;%zu\n", "GCompletion", sizeof(GCompletion), alignof(GCompletion)); printf("%s;%zu;%zu\n", "GCond", sizeof(GCond), alignof(GCond)); printf("%s;%zu;%zu\n", "GConvertError", sizeof(GConvertError), alignof(GConvertError)); printf("%s;%zu;%zu\n", "GDate", sizeof(GDate), alignof(GDate)); @@ -82,6 +83,10 @@ int main() { printf("%s;%zu;%zu\n", "GSourceFuncs", sizeof(GSourceFuncs), alignof(GSourceFuncs)); printf("%s;%zu;%zu\n", "GSpawnError", sizeof(GSpawnError), alignof(GSpawnError)); printf("%s;%zu;%zu\n", "GSpawnFlags", sizeof(GSpawnFlags), alignof(GSpawnFlags)); + printf("%s;%zu;%zu\n", "GStaticMutex", sizeof(GStaticMutex), alignof(GStaticMutex)); + printf("%s;%zu;%zu\n", "GStaticPrivate", sizeof(GStaticPrivate), alignof(GStaticPrivate)); + printf("%s;%zu;%zu\n", "GStaticRWLock", sizeof(GStaticRWLock), alignof(GStaticRWLock)); + printf("%s;%zu;%zu\n", "GStaticRecMutex", sizeof(GStaticRecMutex), alignof(GStaticRecMutex)); printf("%s;%zu;%zu\n", "GString", sizeof(GString), alignof(GString)); printf("%s;%zu;%zu\n", "GStrv", sizeof(GStrv), alignof(GStrv)); printf("%s;%zu;%zu\n", "GTestConfig", sizeof(GTestConfig), alignof(GTestConfig)); @@ -91,8 +96,11 @@ int main() { printf("%s;%zu;%zu\n", "GTestResult", sizeof(GTestResult), alignof(GTestResult)); printf("%s;%zu;%zu\n", "GTestSubprocessFlags", sizeof(GTestSubprocessFlags), alignof(GTestSubprocessFlags)); printf("%s;%zu;%zu\n", "GTestTrapFlags", sizeof(GTestTrapFlags), alignof(GTestTrapFlags)); + printf("%s;%zu;%zu\n", "GThread", sizeof(GThread), alignof(GThread)); printf("%s;%zu;%zu\n", "GThreadError", sizeof(GThreadError), alignof(GThreadError)); + printf("%s;%zu;%zu\n", "GThreadFunctions", sizeof(GThreadFunctions), alignof(GThreadFunctions)); printf("%s;%zu;%zu\n", "GThreadPool", sizeof(GThreadPool), alignof(GThreadPool)); + printf("%s;%zu;%zu\n", "GThreadPriority", sizeof(GThreadPriority), alignof(GThreadPriority)); printf("%s;%zu;%zu\n", "GTime", sizeof(GTime), alignof(GTime)); printf("%s;%zu;%zu\n", "GTimeSpan", sizeof(GTimeSpan), alignof(GTimeSpan)); printf("%s;%zu;%zu\n", "GTimeType", sizeof(GTimeType), alignof(GTimeType)); @@ -102,10 +110,12 @@ int main() { printf("%s;%zu;%zu\n", "GTrashStack", sizeof(GTrashStack), alignof(GTrashStack)); printf("%s;%zu;%zu\n", "GTraverseFlags", sizeof(GTraverseFlags), alignof(GTraverseFlags)); printf("%s;%zu;%zu\n", "GTraverseType", sizeof(GTraverseType), alignof(GTraverseType)); - printf("%s;%zu;%zu\n", "GType", sizeof(GType), alignof(GType)); + printf("%s;%zu;%zu\n", "GTuples", sizeof(GTuples), alignof(GTuples)); printf("%s;%zu;%zu\n", "GUnicodeBreakType", sizeof(GUnicodeBreakType), alignof(GUnicodeBreakType)); printf("%s;%zu;%zu\n", "GUnicodeScript", sizeof(GUnicodeScript), alignof(GUnicodeScript)); printf("%s;%zu;%zu\n", "GUnicodeType", sizeof(GUnicodeType), alignof(GUnicodeType)); + printf("%s;%zu;%zu\n", "GUnixPipe", sizeof(GUnixPipe), alignof(GUnixPipe)); + printf("%s;%zu;%zu\n", "GUnixPipeEnd", sizeof(GUnixPipeEnd), alignof(GUnixPipeEnd)); printf("%s;%zu;%zu\n", "GUriError", sizeof(GUriError), alignof(GUriError)); printf("%s;%zu;%zu\n", "GUriFlags", sizeof(GUriFlags), alignof(GUriFlags)); printf("%s;%zu;%zu\n", "GUriHideFlags", sizeof(GUriHideFlags), alignof(GUriHideFlags)); @@ -117,5 +127,6 @@ int main() { printf("%s;%zu;%zu\n", "GVariantDict", sizeof(GVariantDict), alignof(GVariantDict)); printf("%s;%zu;%zu\n", "GVariantIter", sizeof(GVariantIter), alignof(GVariantIter)); printf("%s;%zu;%zu\n", "GVariantParseError", sizeof(GVariantParseError), alignof(GVariantParseError)); + printf("%s;%zu;%zu\n", "GWin32OSType", sizeof(GWin32OSType), alignof(GWin32OSType)); return 0; } diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/graphene/src/auto/point.rs b/graphene/src/auto/point.rs index 1363f8a5dfd2..447dee94b359 100644 --- a/graphene/src/auto/point.rs +++ b/graphene/src/auto/point.rs @@ -31,13 +31,6 @@ impl Point { } } - #[cfg(feature = "v1_12")] - #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] - #[doc(alias = "graphene_point_distance_squared")] - pub fn distance_squared(&self, b: &Point) -> f32 { - unsafe { ffi::graphene_point_distance_squared(self.to_glib_none().0, b.to_glib_none().0) } - } - #[doc(alias = "graphene_point_equal")] fn equal(&self, b: &Point) -> bool { unsafe { ffi::graphene_point_equal(self.to_glib_none().0, b.to_glib_none().0) } diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/graphene/sys/src/lib.rs b/graphene/sys/src/lib.rs index da1a94e4141a..e5a95e9ae60d 100644 --- a/graphene/sys/src/lib.rs +++ b/graphene/sys/src/lib.rs @@ -922,12 +922,6 @@ extern "C" { d_x: *mut c_float, d_y: *mut c_float, ) -> c_float; - #[cfg(feature = "v1_12")] - #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] - pub fn graphene_point_distance_squared( - a: *const graphene_point_t, - b: *const graphene_point_t, - ) -> c_float; pub fn graphene_point_equal(a: *const graphene_point_t, b: *const graphene_point_t) -> bool; pub fn graphene_point_free(p: *mut graphene_point_t); pub fn graphene_point_init( diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pango/sys/src/lib.rs b/pango/sys/src/lib.rs index 8f799b423fcd..f67b83ea9a02 100644 --- a/pango/sys/src/lib.rs +++ b/pango/sys/src/lib.rs @@ -664,7 +664,7 @@ pub struct _PangoContextClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoContextClass = *mut _PangoContextClass; +pub type PangoContextClass = _PangoContextClass; #[derive(Copy, Clone)] #[repr(C)] @@ -876,7 +876,7 @@ pub struct _PangoFontsetSimpleClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoFontsetSimpleClass = *mut _PangoFontsetSimpleClass; +pub type PangoFontsetSimpleClass = _PangoFontsetSimpleClass; #[derive(Copy, Clone)] #[repr(C)] @@ -1036,7 +1036,7 @@ pub struct _PangoLayoutClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoLayoutClass = *mut _PangoLayoutClass; +pub type PangoLayoutClass = _PangoLayoutClass; #[repr(C)] pub struct PangoLayoutIter { @@ -1207,7 +1207,7 @@ pub struct _PangoRendererPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoRendererPrivate = *mut _PangoRendererPrivate; +pub type PangoRendererPrivate = _PangoRendererPrivate; #[repr(C)] pub struct PangoScriptIter { diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pangocairo/Gir.toml b/pangocairo/Gir.toml index cd36ae5cdd00..20769fefad93 100644 --- a/pangocairo/Gir.toml +++ b/pangocairo/Gir.toml @@ -2,6 +2,7 @@ girs_directories = ["../gir-files"] library = "PangoCairo" version = "1.0" +use_gi_docgen = true target_path = "." work_mode = "normal" generate_safety_asserts = false diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a)