Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate with latest gir files #1324

Merged
merged 5 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gdk-pixbuf/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9ebc44374393)
from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4)
Generated by gir (https://github.com/gtk-rs/gir @ c537d4a59043)
from gir-files (https://github.com/gtk-rs/gir-files @ 2437ecd9a33d)
4 changes: 2 additions & 2 deletions gdk-pixbuf/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9ebc44374393)
from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4)
Generated by gir (https://github.com/gtk-rs/gir @ c537d4a59043)
from gir-files (https://github.com/gtk-rs/gir-files @ 2437ecd9a33d)
57 changes: 57 additions & 0 deletions gio/src/auto/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ impl ApplicationBuilder {
}
}

#[cfg(feature = "v2_80")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))]
pub fn version(self, version: impl Into<glib::GString>) -> Self {
Self {
builder: self.builder.property("version", version.into()),
}
}

// rustdoc-stripper-ignore-next
/// Build the [`Application`].
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
Expand Down Expand Up @@ -267,6 +275,18 @@ pub trait ApplicationExt: IsA<Application> + sealed::Sealed + 'static {
}
}

#[cfg(feature = "v2_80")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))]
#[doc(alias = "g_application_get_version")]
#[doc(alias = "get_version")]
fn version(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::g_application_get_version(
self.as_ref().to_glib_none().0,
))
}
}

#[doc(alias = "g_application_open")]
fn open(&self, files: &[File], hint: &str) {
let n_files = files.len() as _;
Expand Down Expand Up @@ -390,6 +410,18 @@ pub trait ApplicationExt: IsA<Application> + sealed::Sealed + 'static {
}
}

#[cfg(feature = "v2_80")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))]
#[doc(alias = "g_application_set_version")]
fn set_version(&self, version: &str) {
unsafe {
ffi::g_application_set_version(
self.as_ref().to_glib_none().0,
version.to_glib_none().0,
);
}
}

#[doc(alias = "g_application_unbind_busy_property")]
fn unbind_busy_property(&self, object: &impl IsA<glib::Object>, property: &str) {
unsafe {
Expand Down Expand Up @@ -774,6 +806,31 @@ pub trait ApplicationExt: IsA<Application> + sealed::Sealed + 'static {
)
}
}

#[cfg(feature = "v2_80")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))]
#[doc(alias = "version")]
fn connect_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_version_trampoline<P: IsA<Application>, F: Fn(&P) + 'static>(
this: *mut ffi::GApplication,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Application::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::version\0".as_ptr() as *const _,
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
notify_version_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

impl<O: IsA<Application>> ApplicationExt for O {}
4 changes: 2 additions & 2 deletions gio/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9ebc44374393)
from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4)
Generated by gir (https://github.com/gtk-rs/gir @ c537d4a59043)
from gir-files (https://github.com/gtk-rs/gir-files @ 2437ecd9a33d)
14 changes: 0 additions & 14 deletions gio/sys/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,3 @@ 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
6 changes: 6 additions & 0 deletions gio/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10099,6 +10099,9 @@ extern "C" {
pub fn g_application_get_is_registered(application: *mut GApplication) -> gboolean;
pub fn g_application_get_is_remote(application: *mut GApplication) -> gboolean;
pub fn g_application_get_resource_base_path(application: *mut GApplication) -> *const c_char;
#[cfg(feature = "v2_80")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))]
pub fn g_application_get_version(application: *mut GApplication) -> *const c_char;
pub fn g_application_hold(application: *mut GApplication);
pub fn g_application_mark_busy(application: *mut GApplication);
pub fn g_application_open(
Expand Down Expand Up @@ -10154,6 +10157,9 @@ extern "C" {
application: *mut GApplication,
resource_path: *const c_char,
);
#[cfg(feature = "v2_80")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))]
pub fn g_application_set_version(application: *mut GApplication, version: *const c_char);
pub fn g_application_unbind_busy_property(
application: *mut GApplication,
object: *mut gobject::GObject,
Expand Down
4 changes: 2 additions & 2 deletions gio/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9ebc44374393)
from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4)
Generated by gir (https://github.com/gtk-rs/gir @ c537d4a59043)
from gir-files (https://github.com/gtk-rs/gir-files @ 2437ecd9a33d)
2 changes: 1 addition & 1 deletion gir
2 changes: 1 addition & 1 deletion gir-files
46 changes: 3 additions & 43 deletions glib/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,41 +79,6 @@ 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
Expand All @@ -136,6 +101,9 @@ status = "generate"
pattern = "(clear_handle_id|clear_list|clear_pointer|clear_slist|clear_error|nullify_pointer)"
ignore = true # Not useful freeing functions
[[object.function]]
pattern = "(fdwalk_set_cloexec|closefrom)"
ignore = true # unsafe
[[object.function]]
pattern = "(datalist_.*|dataset_.*)"
ignore = true # Not useful GData related functions
[[object.function]]
Expand All @@ -157,9 +125,6 @@ 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]]
Expand Down Expand Up @@ -951,8 +916,3 @@ status = "generate"
name = "GLib.Uri"
status = "generate"
concurrency = "send+sync"

[[object]]
name = "GLib.Win32OSType"
status = "generate"
cfg_condition = "windows"
4 changes: 2 additions & 2 deletions glib/gobject-sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9ebc44374393)
from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4)
Generated by gir (https://github.com/gtk-rs/gir @ c537d4a59043)
from gir-files (https://github.com/gtk-rs/gir-files @ 2437ecd9a33d)
46 changes: 0 additions & 46 deletions glib/src/auto/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2352,49 +2352,3 @@ impl FromGlib<ffi::GVariantClass> 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<ffi::GWin32OSType> 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),
}
}
}
55 changes: 0 additions & 55 deletions glib/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#[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,
UserDirectory,
Expand Down Expand Up @@ -630,11 +627,6 @@ 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<std::ffi::OsStr>,
Expand Down Expand Up @@ -864,50 +856,3 @@ 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<crate::GString> {
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()) }
}
3 changes: 0 additions & 3 deletions glib/src/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ 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")]
Expand Down
4 changes: 2 additions & 2 deletions glib/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9ebc44374393)
from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4)
Generated by gir (https://github.com/gtk-rs/gir @ c537d4a59043)
from gir-files (https://github.com/gtk-rs/gir-files @ 2437ecd9a33d)
Loading
Loading