diff options
author | Vika <vika@fireburn.ru> | 2025-01-30 08:49:22 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-01-30 08:49:22 +0300 |
commit | 62263e0e619625f2c5dd0b4364b43bd4fefc8ccd (patch) | |
tree | c796d7f78c2205dff77eacb02d43024a254c6d67 /libsecret/src/auto/collection.rs | |
parent | 320de85d04061ccc3ce50fb9a460a28068f7146a (diff) | |
download | bowl-62263e0e619625f2c5dd0b4364b43bd4fefc8ccd.tar.zst |
libsecret: 0.6.0 (private fork) -> 0.7.0 (upstream)
libsecret is now maintained again! No need for a private fork.
Diffstat (limited to 'libsecret/src/auto/collection.rs')
-rw-r--r-- | libsecret/src/auto/collection.rs | 742 |
1 files changed, 0 insertions, 742 deletions
diff --git a/libsecret/src/auto/collection.rs b/libsecret/src/auto/collection.rs deleted file mode 100644 index 8c91b65..0000000 --- a/libsecret/src/auto/collection.rs +++ /dev/null @@ -1,742 +0,0 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git) -// DO NOT EDIT - -use crate::{CollectionCreateFlags, CollectionFlags, Item, Service}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::{boxed::Box as Box_, pin::Pin}; - -glib::wrapper! { - #[doc(alias = "SecretCollection")] - pub struct Collection(Object<ffi::SecretCollection, ffi::SecretCollectionClass>) @extends gio::DBusProxy, @implements gio::DBusInterface, gio::Initable; - - match fn { - type_ => || ffi::secret_collection_get_type(), - } -} - -impl Collection { - pub const NONE: Option<&'static Collection> = None; - - #[doc(alias = "secret_collection_new_for_dbus_path_sync")] - #[doc(alias = "new_for_dbus_path_sync")] - pub fn for_dbus_path_sync( - service: Option<&impl IsA<Service>>, - collection_path: &str, - flags: CollectionFlags, - cancellable: Option<&impl IsA<gio::Cancellable>>, - ) -> Result<Collection, glib::Error> { - unsafe { - let mut error = std::ptr::null_mut(); - let ret = ffi::secret_collection_new_for_dbus_path_sync( - service.map(|p| p.as_ref()).to_glib_none().0, - collection_path.to_glib_none().0, - flags.into_glib(), - cancellable.map(|p| p.as_ref()).to_glib_none().0, - &mut error, - ); - if error.is_null() { - Ok(from_glib_full(ret)) - } else { - Err(from_glib_full(error)) - } - } - } - - #[doc(alias = "secret_collection_create")] - pub fn create<P: FnOnce(Result<Collection, glib::Error>) + 'static>( - service: Option<&impl IsA<Service>>, - label: &str, - alias: Option<&str>, - flags: CollectionCreateFlags, - cancellable: Option<&impl IsA<gio::Cancellable>>, - callback: P, - ) { - let main_context = glib::MainContext::ref_thread_default(); - let is_main_context_owner = main_context.is_owner(); - let has_acquired_main_context = (!is_main_context_owner) - .then(|| main_context.acquire().ok()) - .flatten(); - assert!( - is_main_context_owner || has_acquired_main_context.is_some(), - "Async operations only allowed if the thread is owning the MainContext" - ); - - let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::new(glib::thread_guard::ThreadGuard::new(callback)); - unsafe extern "C" fn create_trampoline< - P: FnOnce(Result<Collection, glib::Error>) + 'static, - >( - _source_object: *mut glib::gobject_ffi::GObject, - res: *mut gio::ffi::GAsyncResult, - user_data: glib::ffi::gpointer, - ) { - let mut error = std::ptr::null_mut(); - let ret = ffi::secret_collection_create_finish(res, &mut error); - let result = if error.is_null() { - Ok(from_glib_full(ret)) - } else { - Err(from_glib_full(error)) - }; - let callback: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::from_raw(user_data as *mut _); - let callback: P = callback.into_inner(); - callback(result); - } - let callback = create_trampoline::<P>; - unsafe { - ffi::secret_collection_create( - service.map(|p| p.as_ref()).to_glib_none().0, - label.to_glib_none().0, - alias.to_glib_none().0, - flags.into_glib(), - cancellable.map(|p| p.as_ref()).to_glib_none().0, - Some(callback), - Box_::into_raw(user_data) as *mut _, - ); - } - } - - pub fn create_future( - service: Option<&(impl IsA<Service> + Clone + 'static)>, - label: &str, - alias: Option<&str>, - flags: CollectionCreateFlags, - ) -> Pin<Box_<dyn std::future::Future<Output = Result<Collection, glib::Error>> + 'static>> - { - let service = service.map(ToOwned::to_owned); - let label = String::from(label); - let alias = alias.map(ToOwned::to_owned); - Box_::pin(gio::GioFuture::new(&(), move |_obj, cancellable, send| { - Self::create( - service.as_ref().map(::std::borrow::Borrow::borrow), - &label, - alias.as_ref().map(::std::borrow::Borrow::borrow), - flags, - Some(cancellable), - move |res| { - send.resolve(res); - }, - ); - })) - } - - #[doc(alias = "secret_collection_create_sync")] - pub fn create_sync( - service: Option<&impl IsA<Service>>, - label: &str, - alias: Option<&str>, - flags: CollectionCreateFlags, - cancellable: Option<&impl IsA<gio::Cancellable>>, - ) -> Result<Collection, glib::Error> { - unsafe { - let mut error = std::ptr::null_mut(); - let ret = ffi::secret_collection_create_sync( - service.map(|p| p.as_ref()).to_glib_none().0, - label.to_glib_none().0, - alias.to_glib_none().0, - flags.into_glib(), - cancellable.map(|p| p.as_ref()).to_glib_none().0, - &mut error, - ); - if error.is_null() { - Ok(from_glib_full(ret)) - } else { - Err(from_glib_full(error)) - } - } - } - - #[doc(alias = "secret_collection_for_alias")] - pub fn for_alias<P: FnOnce(Result<Option<Collection>, glib::Error>) + 'static>( - service: Option<&impl IsA<Service>>, - alias: &str, - flags: CollectionFlags, - cancellable: Option<&impl IsA<gio::Cancellable>>, - callback: P, - ) { - let main_context = glib::MainContext::ref_thread_default(); - let is_main_context_owner = main_context.is_owner(); - let has_acquired_main_context = (!is_main_context_owner) - .then(|| main_context.acquire().ok()) - .flatten(); - assert!( - is_main_context_owner || has_acquired_main_context.is_some(), - "Async operations only allowed if the thread is owning the MainContext" - ); - - let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::new(glib::thread_guard::ThreadGuard::new(callback)); - unsafe extern "C" fn for_alias_trampoline< - P: FnOnce(Result<Option<Collection>, glib::Error>) + 'static, - >( - _source_object: *mut glib::gobject_ffi::GObject, - res: *mut gio::ffi::GAsyncResult, - user_data: glib::ffi::gpointer, - ) { - let mut error = std::ptr::null_mut(); - let ret = ffi::secret_collection_for_alias_finish(res, &mut error); - let result = if error.is_null() { - Ok(from_glib_full(ret)) - } else { - Err(from_glib_full(error)) - }; - let callback: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::from_raw(user_data as *mut _); - let callback: P = callback.into_inner(); - callback(result); - } - let callback = for_alias_trampoline::<P>; - unsafe { - ffi::secret_collection_for_alias( - service.map(|p| p.as_ref()).to_glib_none().0, - alias.to_glib_none().0, - flags.into_glib(), - cancellable.map(|p| p.as_ref()).to_glib_none().0, - Some(callback), - Box_::into_raw(user_data) as *mut _, - ); - } - } - - pub fn for_alias_future( - service: Option<&(impl IsA<Service> + Clone + 'static)>, - alias: &str, - flags: CollectionFlags, - ) -> Pin< - Box_<dyn std::future::Future<Output = Result<Option<Collection>, glib::Error>> + 'static>, - > { - let service = service.map(ToOwned::to_owned); - let alias = String::from(alias); - Box_::pin(gio::GioFuture::new(&(), move |_obj, cancellable, send| { - Self::for_alias( - service.as_ref().map(::std::borrow::Borrow::borrow), - &alias, - flags, - Some(cancellable), - move |res| { - send.resolve(res); - }, - ); - })) - } - - #[doc(alias = "secret_collection_for_alias_sync")] - pub fn for_alias_sync( - service: Option<&impl IsA<Service>>, - alias: &str, - flags: CollectionFlags, - cancellable: Option<&impl IsA<gio::Cancellable>>, - ) -> Result<Option<Collection>, glib::Error> { - unsafe { - let mut error = std::ptr::null_mut(); - let ret = ffi::secret_collection_for_alias_sync( - service.map(|p| p.as_ref()).to_glib_none().0, - alias.to_glib_none().0, - flags.into_glib(), - cancellable.map(|p| p.as_ref()).to_glib_none().0, - &mut error, - ); - if error.is_null() { - Ok(from_glib_full(ret)) - } else { - Err(from_glib_full(error)) - } - } - } - - #[doc(alias = "secret_collection_new_for_dbus_path")] - pub fn new_for_dbus_path<P: FnOnce(Result<Collection, glib::Error>) + 'static>( - service: Option<&impl IsA<Service>>, - collection_path: &str, - flags: CollectionFlags, - cancellable: Option<&impl IsA<gio::Cancellable>>, - callback: P, - ) { - let main_context = glib::MainContext::ref_thread_default(); - let is_main_context_owner = main_context.is_owner(); - let has_acquired_main_context = (!is_main_context_owner) - .then(|| main_context.acquire().ok()) - .flatten(); - assert!( - is_main_context_owner || has_acquired_main_context.is_some(), - "Async operations only allowed if the thread is owning the MainContext" - ); - - let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::new(glib::thread_guard::ThreadGuard::new(callback)); - unsafe extern "C" fn new_for_dbus_path_trampoline< - P: FnOnce(Result<Collection, glib::Error>) + 'static, - >( - _source_object: *mut glib::gobject_ffi::GObject, - res: *mut gio::ffi::GAsyncResult, - user_data: glib::ffi::gpointer, - ) { - let mut error = std::ptr::null_mut(); - let ret = ffi::secret_collection_new_for_dbus_path_finish(res, &mut error); - let result = if error.is_null() { - Ok(from_glib_full(ret)) - } else { - Err(from_glib_full(error)) - }; - let callback: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::from_raw(user_data as *mut _); - let callback: P = callback.into_inner(); - callback(result); - } - let callback = new_for_dbus_path_trampoline::<P>; - unsafe { - ffi::secret_collection_new_for_dbus_path( - service.map(|p| p.as_ref()).to_glib_none().0, - collection_path.to_glib_none().0, - flags.into_glib(), - cancellable.map(|p| p.as_ref()).to_glib_none().0, - Some(callback), - Box_::into_raw(user_data) as *mut _, - ); - } - } - - pub fn new_for_dbus_path_future( - service: Option<&(impl IsA<Service> + Clone + 'static)>, - collection_path: &str, - flags: CollectionFlags, - ) -> Pin<Box_<dyn std::future::Future<Output = Result<Collection, glib::Error>> + 'static>> - { - let service = service.map(ToOwned::to_owned); - let collection_path = String::from(collection_path); - Box_::pin(gio::GioFuture::new(&(), move |_obj, cancellable, send| { - Self::new_for_dbus_path( - service.as_ref().map(::std::borrow::Borrow::borrow), - &collection_path, - flags, - Some(cancellable), - move |res| { - send.resolve(res); - }, - ); - })) - } -} - -mod sealed { - pub trait Sealed {} - impl<T: super::IsA<super::Collection>> Sealed for T {} -} - -pub trait CollectionExt: IsA<Collection> + sealed::Sealed + 'static { - #[doc(alias = "secret_collection_delete")] - fn delete<P: FnOnce(Result<(), glib::Error>) + 'static>( - &self, - cancellable: Option<&impl IsA<gio::Cancellable>>, - callback: P, - ) { - let main_context = glib::MainContext::ref_thread_default(); - let is_main_context_owner = main_context.is_owner(); - let has_acquired_main_context = (!is_main_context_owner) - .then(|| main_context.acquire().ok()) - .flatten(); - assert!( - is_main_context_owner || has_acquired_main_context.is_some(), - "Async operations only allowed if the thread is owning the MainContext" - ); - - let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::new(glib::thread_guard::ThreadGuard::new(callback)); - unsafe extern "C" fn delete_trampoline<P: FnOnce(Result<(), glib::Error>) + 'static>( - _source_object: *mut glib::gobject_ffi::GObject, - res: *mut gio::ffi::GAsyncResult, - user_data: glib::ffi::gpointer, - ) { - let mut error = std::ptr::null_mut(); - let _ = ffi::secret_collection_delete_finish(_source_object as *mut _, res, &mut error); - let result = if error.is_null() { - Ok(()) - } else { - Err(from_glib_full(error)) - }; - let callback: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::from_raw(user_data as *mut _); - let callback: P = callback.into_inner(); - callback(result); - } - let callback = delete_trampoline::<P>; - unsafe { - ffi::secret_collection_delete( - self.as_ref().to_glib_none().0, - cancellable.map(|p| p.as_ref()).to_glib_none().0, - Some(callback), - Box_::into_raw(user_data) as *mut _, - ); - } - } - - fn delete_future( - &self, - ) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> { - Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| { - obj.delete(Some(cancellable), move |res| { - send.resolve(res); - }); - })) - } - - #[doc(alias = "secret_collection_delete_sync")] - fn delete_sync( - &self, - cancellable: Option<&impl IsA<gio::Cancellable>>, - ) -> Result<(), glib::Error> { - unsafe { - let mut error = std::ptr::null_mut(); - let is_ok = ffi::secret_collection_delete_sync( - self.as_ref().to_glib_none().0, - cancellable.map(|p| p.as_ref()).to_glib_none().0, - &mut error, - ); - debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); - if error.is_null() { - Ok(()) - } else { - Err(from_glib_full(error)) - } - } - } - - #[doc(alias = "secret_collection_get_created")] - #[doc(alias = "get_created")] - fn created(&self) -> u64 { - unsafe { ffi::secret_collection_get_created(self.as_ref().to_glib_none().0) } - } - - #[doc(alias = "secret_collection_get_flags")] - #[doc(alias = "get_flags")] - fn flags(&self) -> CollectionFlags { - unsafe { - from_glib(ffi::secret_collection_get_flags( - self.as_ref().to_glib_none().0, - )) - } - } - - #[doc(alias = "secret_collection_get_items")] - #[doc(alias = "get_items")] - fn items(&self) -> Vec<Item> { - unsafe { - FromGlibPtrContainer::from_glib_full(ffi::secret_collection_get_items( - self.as_ref().to_glib_none().0, - )) - } - } - - #[doc(alias = "secret_collection_get_label")] - #[doc(alias = "get_label")] - fn label(&self) -> glib::GString { - unsafe { - from_glib_full(ffi::secret_collection_get_label( - self.as_ref().to_glib_none().0, - )) - } - } - - #[doc(alias = "secret_collection_get_locked")] - #[doc(alias = "get_locked")] - fn is_locked(&self) -> bool { - unsafe { - from_glib(ffi::secret_collection_get_locked( - self.as_ref().to_glib_none().0, - )) - } - } - - #[doc(alias = "secret_collection_get_modified")] - #[doc(alias = "get_modified")] - fn modified(&self) -> u64 { - unsafe { ffi::secret_collection_get_modified(self.as_ref().to_glib_none().0) } - } - - #[doc(alias = "secret_collection_get_service")] - #[doc(alias = "get_service")] - fn service(&self) -> Service { - unsafe { - from_glib_none(ffi::secret_collection_get_service( - self.as_ref().to_glib_none().0, - )) - } - } - - #[doc(alias = "secret_collection_load_items")] - fn load_items<P: FnOnce(Result<(), glib::Error>) + 'static>( - &self, - cancellable: Option<&impl IsA<gio::Cancellable>>, - callback: P, - ) { - let main_context = glib::MainContext::ref_thread_default(); - let is_main_context_owner = main_context.is_owner(); - let has_acquired_main_context = (!is_main_context_owner) - .then(|| main_context.acquire().ok()) - .flatten(); - assert!( - is_main_context_owner || has_acquired_main_context.is_some(), - "Async operations only allowed if the thread is owning the MainContext" - ); - - let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::new(glib::thread_guard::ThreadGuard::new(callback)); - unsafe extern "C" fn load_items_trampoline<P: FnOnce(Result<(), glib::Error>) + 'static>( - _source_object: *mut glib::gobject_ffi::GObject, - res: *mut gio::ffi::GAsyncResult, - user_data: glib::ffi::gpointer, - ) { - let mut error = std::ptr::null_mut(); - let _ = - ffi::secret_collection_load_items_finish(_source_object as *mut _, res, &mut error); - let result = if error.is_null() { - Ok(()) - } else { - Err(from_glib_full(error)) - }; - let callback: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::from_raw(user_data as *mut _); - let callback: P = callback.into_inner(); - callback(result); - } - let callback = load_items_trampoline::<P>; - unsafe { - ffi::secret_collection_load_items( - self.as_ref().to_glib_none().0, - cancellable.map(|p| p.as_ref()).to_glib_none().0, - Some(callback), - Box_::into_raw(user_data) as *mut _, - ); - } - } - - fn load_items_future( - &self, - ) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> { - Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| { - obj.load_items(Some(cancellable), move |res| { - send.resolve(res); - }); - })) - } - - #[doc(alias = "secret_collection_load_items_sync")] - fn load_items_sync( - &self, - cancellable: Option<&impl IsA<gio::Cancellable>>, - ) -> Result<(), glib::Error> { - unsafe { - let mut error = std::ptr::null_mut(); - let is_ok = ffi::secret_collection_load_items_sync( - self.as_ref().to_glib_none().0, - cancellable.map(|p| p.as_ref()).to_glib_none().0, - &mut error, - ); - debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); - if error.is_null() { - Ok(()) - } else { - Err(from_glib_full(error)) - } - } - } - - #[doc(alias = "secret_collection_refresh")] - fn refresh(&self) { - unsafe { - ffi::secret_collection_refresh(self.as_ref().to_glib_none().0); - } - } - - #[doc(alias = "secret_collection_set_label")] - fn set_label<P: FnOnce(Result<(), glib::Error>) + 'static>( - &self, - label: &str, - cancellable: Option<&impl IsA<gio::Cancellable>>, - callback: P, - ) { - let main_context = glib::MainContext::ref_thread_default(); - let is_main_context_owner = main_context.is_owner(); - let has_acquired_main_context = (!is_main_context_owner) - .then(|| main_context.acquire().ok()) - .flatten(); - assert!( - is_main_context_owner || has_acquired_main_context.is_some(), - "Async operations only allowed if the thread is owning the MainContext" - ); - - let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::new(glib::thread_guard::ThreadGuard::new(callback)); - unsafe extern "C" fn set_label_trampoline<P: FnOnce(Result<(), glib::Error>) + 'static>( - _source_object: *mut glib::gobject_ffi::GObject, - res: *mut gio::ffi::GAsyncResult, - user_data: glib::ffi::gpointer, - ) { - let mut error = std::ptr::null_mut(); - let _ = - ffi::secret_collection_set_label_finish(_source_object as *mut _, res, &mut error); - let result = if error.is_null() { - Ok(()) - } else { - Err(from_glib_full(error)) - }; - let callback: Box_<glib::thread_guard::ThreadGuard<P>> = - Box_::from_raw(user_data as *mut _); - let callback: P = callback.into_inner(); - callback(result); - } - let callback = set_label_trampoline::<P>; - unsafe { - ffi::secret_collection_set_label( - self.as_ref().to_glib_none().0, - label.to_glib_none().0, - cancellable.map(|p| p.as_ref()).to_glib_none().0, - Some(callback), - Box_::into_raw(user_data) as *mut _, - ); - } - } - - fn set_label_future( - &self, - label: &str, - ) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> { - let label = String::from(label); - Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| { - obj.set_label(&label, Some(cancellable), move |res| { - send.resolve(res); - }); - })) - } - - #[doc(alias = "secret_collection_set_label_sync")] - fn set_label_sync( - &self, - label: &str, - cancellable: Option<&impl IsA<gio::Cancellable>>, - ) -> Result<(), glib::Error> { - unsafe { - let mut error = std::ptr::null_mut(); - let is_ok = ffi::secret_collection_set_label_sync( - self.as_ref().to_glib_none().0, - label.to_glib_none().0, - cancellable.map(|p| p.as_ref()).to_glib_none().0, - &mut error, - ); - debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); - if error.is_null() { - Ok(()) - } else { - Err(from_glib_full(error)) - } - } - } - - fn set_created(&self, created: u64) { - ObjectExt::set_property(self.as_ref(), "created", created) - } - - fn set_modified(&self, modified: u64) { - ObjectExt::set_property(self.as_ref(), "modified", modified) - } - - #[doc(alias = "created")] - fn connect_created_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_created_trampoline<P: IsA<Collection>, F: Fn(&P) + 'static>( - this: *mut ffi::SecretCollection, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { - let f: &F = &*(f as *const F); - f(Collection::from_glib_borrow(this).unsafe_cast_ref()) - } - unsafe { - let f: Box_<F> = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::created\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>( - notify_created_trampoline::<Self, F> as *const (), - )), - Box_::into_raw(f), - ) - } - } - - #[doc(alias = "label")] - fn connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_label_trampoline<P: IsA<Collection>, F: Fn(&P) + 'static>( - this: *mut ffi::SecretCollection, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { - let f: &F = &*(f as *const F); - f(Collection::from_glib_borrow(this).unsafe_cast_ref()) - } - unsafe { - let f: Box_<F> = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::label\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>( - notify_label_trampoline::<Self, F> as *const (), - )), - Box_::into_raw(f), - ) - } - } - - #[doc(alias = "locked")] - fn connect_locked_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_locked_trampoline<P: IsA<Collection>, F: Fn(&P) + 'static>( - this: *mut ffi::SecretCollection, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { - let f: &F = &*(f as *const F); - f(Collection::from_glib_borrow(this).unsafe_cast_ref()) - } - unsafe { - let f: Box_<F> = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::locked\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>( - notify_locked_trampoline::<Self, F> as *const (), - )), - Box_::into_raw(f), - ) - } - } - - #[doc(alias = "modified")] - fn connect_modified_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_modified_trampoline<P: IsA<Collection>, F: Fn(&P) + 'static>( - this: *mut ffi::SecretCollection, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { - let f: &F = &*(f as *const F); - f(Collection::from_glib_borrow(this).unsafe_cast_ref()) - } - unsafe { - let f: Box_<F> = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::modified\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>( - notify_modified_trampoline::<Self, F> as *const (), - )), - Box_::into_raw(f), - ) - } - } -} - -impl<O: IsA<Collection>> CollectionExt for O {} |