Skip to content

Commit 9585bff

Browse files
committed
Manually implement interface-proxy-properties-changed
1 parent 627529d commit 9585bff

File tree

4 files changed

+62
-13
lines changed

4 files changed

+62
-13
lines changed

gio/Gir.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ status = "generate"
703703
name = "Gio.DBusObjectManagerClient"
704704
status = "generate"
705705
concurrency = "send+sync"
706+
manual_traits = ["DBusObjectManagerClientExtManual"]
706707
[[object.function]]
707708
name = "new"
708709
manual = true
@@ -729,6 +730,10 @@ concurrency = "send+sync"
729730
name = "get-proxy-type-user-data"
730731
# C API
731732
ignore = true
733+
[[object.signal]]
734+
name = "interface-proxy-properties-changed"
735+
# **libc::c_char not handled by generator
736+
manual = true
732737

733738
[[object]]
734739
name = "Gio.DBusProxy"

gio/src/auto/dbus_object_manager_client.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ pub trait DBusObjectManagerClientExt: IsA<DBusObjectManagerClient> + 'static {
7979
}
8080
}
8181

82-
//#[doc(alias = "interface-proxy-properties-changed")]
83-
//fn connect_interface_proxy_properties_changed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
84-
// Empty ctype invalidated_properties: *.CArray TypeId { ns_id: 0, id: 28 }
85-
//}
86-
8782
#[doc(alias = "interface-proxy-signal")]
8883
fn connect_interface_proxy_signal<
8984
F: Fn(&Self, &DBusObjectProxy, &DBusProxy, &str, &str, &glib::Variant) + Send + Sync + 'static,

gio/src/dbus_object_manager_client.rs

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
use crate::{
44
ffi, BusType, Cancellable, DBusConnection, DBusObjectManagerClient,
5-
DBusObjectManagerClientFlags, GioFuture,
5+
DBusObjectManagerClientFlags, DBusObjectProxy, DBusProxy, GioFuture,
66
};
7-
use glib::object::IsA;
8-
use glib::translate::{from_glib_borrow, from_glib_full, Borrowed, IntoGlib as _, ToGlibPtr as _};
7+
use glib::object::{Cast as _, IsA};
8+
use glib::signal::connect_raw;
9+
use glib::translate::{
10+
from_glib_borrow, from_glib_full, Borrowed, FromGlibPtrBorrow as _, IntoGlib as _,
11+
ToGlibPtr as _,
12+
};
13+
use glib::{SignalHandlerId, StrVRef};
914
use std::future::Future;
1015
use std::pin::Pin;
1116

@@ -473,3 +478,47 @@ impl DBusObjectManagerClient {
473478
}
474479
}
475480
}
481+
482+
pub trait DBusObjectManagerClientExtManual: IsA<DBusObjectManagerClient> + 'static {
483+
#[doc(alias = "interface-proxy-properties-changed")]
484+
fn connect_interface_proxy_properties_changed<
485+
F: Fn(&Self, &DBusObjectProxy, &DBusProxy, &glib::Variant, &StrVRef) + Send + Sync + 'static,
486+
>(
487+
&self,
488+
f: F,
489+
) -> SignalHandlerId {
490+
unsafe extern "C" fn interface_proxy_properties_changed_trampoline<
491+
P: IsA<DBusObjectManagerClient>,
492+
F: Fn(&P, &DBusObjectProxy, &DBusProxy, &glib::Variant, &StrVRef) + Send + Sync + 'static,
493+
>(
494+
this: *mut ffi::GDBusObjectManagerClient,
495+
object_proxy: *mut ffi::GDBusObjectProxy,
496+
interface_proxy: *mut ffi::GDBusProxy,
497+
changed_properties: *mut glib::ffi::GVariant,
498+
invalidated_properties: *const *const std::ffi::c_char,
499+
f: glib::ffi::gpointer,
500+
) {
501+
let f: &F = &*(f as *const F);
502+
f(
503+
DBusObjectManagerClient::from_glib_borrow(this).unsafe_cast_ref(),
504+
&from_glib_borrow(object_proxy),
505+
&from_glib_borrow(interface_proxy),
506+
&from_glib_borrow(changed_properties),
507+
StrVRef::from_glib_borrow(invalidated_properties),
508+
)
509+
}
510+
unsafe {
511+
let f: Box<F> = Box::new(f);
512+
connect_raw(
513+
self.as_ptr() as *mut _,
514+
c"interface-proxy-properties-changed".as_ptr() as *const _,
515+
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
516+
interface_proxy_properties_changed_trampoline::<Self, F> as *const (),
517+
)),
518+
Box::into_raw(f),
519+
)
520+
}
521+
}
522+
}
523+
524+
impl<O: IsA<DBusObjectManagerClient>> DBusObjectManagerClientExtManual for O {}

gio/src/prelude.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ pub use crate::{
3636
application_command_line::ApplicationCommandLineExtManual, auto::traits::*,
3737
cancellable::CancellableExtManual, converter::ConverterExtManual,
3838
data_input_stream::DataInputStreamExtManual, datagram_based::DatagramBasedExtManual,
39-
dbus_connection::DBusMethodCall, dbus_proxy::DBusProxyExtManual, file::FileExtManual,
40-
file_enumerator::FileEnumeratorExtManual, inet_address::InetAddressExtManual,
41-
input_stream::InputStreamExtManual, io_stream::IOStreamExtManual,
42-
list_model::ListModelExtManual, output_stream::OutputStreamExtManual,
43-
pollable_input_stream::PollableInputStreamExtManual,
39+
dbus_connection::DBusMethodCall, dbus_object_manager_client::DBusObjectManagerClientExtManual,
40+
dbus_proxy::DBusProxyExtManual, file::FileExtManual, file_enumerator::FileEnumeratorExtManual,
41+
inet_address::InetAddressExtManual, input_stream::InputStreamExtManual,
42+
io_stream::IOStreamExtManual, list_model::ListModelExtManual,
43+
output_stream::OutputStreamExtManual, pollable_input_stream::PollableInputStreamExtManual,
4444
pollable_output_stream::PollableOutputStreamExtManual, settings::SettingsExtManual,
4545
simple_proxy_resolver::SimpleProxyResolverExtManual, socket::SocketExtManual,
4646
socket_control_message::SocketControlMessageExtManual,

0 commit comments

Comments
 (0)