use crate::Channel;
use crate::SessionMigration;
use crate::SessionVerify;
use crate::URI;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "SpiceSession")]
pub struct Session(Object<ffi::SpiceSession, ffi::SpiceSessionClass>);
match fn {
type_ => || ffi::spice_session_get_type(),
}
}
impl Session {
#[doc(alias = "spice_session_new")]
pub fn new() -> Session {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::spice_session_new()) }
}
#[doc(alias = "spice_session_connect")]
pub fn connect(&self) -> bool {
unsafe { from_glib(ffi::spice_session_connect(self.to_glib_none().0)) }
}
#[doc(alias = "spice_session_disconnect")]
pub fn disconnect(&self) {
unsafe {
ffi::spice_session_disconnect(self.to_glib_none().0);
}
}
#[doc(alias = "spice_session_get_channels")]
#[doc(alias = "get_channels")]
pub fn channels(&self) -> Vec<Channel> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::spice_session_get_channels(
self.to_glib_none().0,
))
}
}
#[doc(alias = "spice_session_get_proxy_uri")]
#[doc(alias = "get_proxy_uri")]
pub fn proxy_uri(&self) -> Option<URI> {
unsafe { from_glib_none(ffi::spice_session_get_proxy_uri(self.to_glib_none().0)) }
}
#[doc(alias = "spice_session_get_read_only")]
#[doc(alias = "get_read_only")]
pub fn is_read_only(&self) -> bool {
unsafe { from_glib(ffi::spice_session_get_read_only(self.to_glib_none().0)) }
}
#[doc(alias = "spice_session_has_channel_type")]
pub fn has_channel_type(&self, type_: i32) -> bool {
unsafe {
from_glib(ffi::spice_session_has_channel_type(
self.to_glib_none().0,
type_,
))
}
}
#[doc(alias = "spice_session_is_for_migration")]
pub fn is_for_migration(&self) -> bool {
unsafe { from_glib(ffi::spice_session_is_for_migration(self.to_glib_none().0)) }
}
#[doc(alias = "spice_session_open_fd")]
pub fn open_fd(&self, fd: i32) -> bool {
unsafe { from_glib(ffi::spice_session_open_fd(self.to_glib_none().0, fd)) }
}
pub fn ca(&self) -> Option<glib::ByteArray> {
unsafe {
let mut value = glib::Value::from_type(<glib::ByteArray as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"ca\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().expect("Return Value for property `ca` getter")
}
}
pub fn set_ca(&self, ca: Option<&glib::ByteArray>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"ca\0".as_ptr() as *const _,
ca.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "ca-file")]
pub fn ca_file(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"ca-file\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `ca-file` getter")
}
}
#[doc(alias = "ca-file")]
pub fn set_ca_file(&self, ca_file: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"ca-file\0".as_ptr() as *const _,
ca_file.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "cache-size")]
pub fn cache_size(&self) -> i32 {
unsafe {
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"cache-size\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `cache-size` getter")
}
}
#[doc(alias = "cache-size")]
pub fn set_cache_size(&self, cache_size: i32) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"cache-size\0".as_ptr() as *const _,
cache_size.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "cert-subject")]
pub fn cert_subject(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"cert-subject\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `cert-subject` getter")
}
}
#[doc(alias = "cert-subject")]
pub fn set_cert_subject(&self, cert_subject: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"cert-subject\0".as_ptr() as *const _,
cert_subject.to_value().to_glib_none().0,
);
}
}
pub fn ciphers(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"ciphers\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `ciphers` getter")
}
}
pub fn set_ciphers(&self, ciphers: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"ciphers\0".as_ptr() as *const _,
ciphers.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "client-sockets")]
pub fn is_client_sockets(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"client-sockets\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `client-sockets` getter")
}
}
#[doc(alias = "client-sockets")]
pub fn set_client_sockets(&self, client_sockets: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"client-sockets\0".as_ptr() as *const _,
client_sockets.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "disable-effects")]
pub fn disable_effects(&self) -> Vec<glib::GString> {
unsafe {
let mut value =
glib::Value::from_type(<Vec<glib::GString> as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"disable-effects\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `disable-effects` getter")
}
}
#[doc(alias = "disable-effects")]
pub fn set_disable_effects(&self, disable_effects: &[&str]) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"disable-effects\0".as_ptr() as *const _,
disable_effects.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "enable-audio")]
pub fn enables_audio(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"enable-audio\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `enable-audio` getter")
}
}
#[doc(alias = "enable-audio")]
pub fn set_enable_audio(&self, enable_audio: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"enable-audio\0".as_ptr() as *const _,
enable_audio.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "enable-smartcard")]
pub fn enables_smartcard(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"enable-smartcard\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `enable-smartcard` getter")
}
}
#[doc(alias = "enable-smartcard")]
pub fn set_enable_smartcard(&self, enable_smartcard: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"enable-smartcard\0".as_ptr() as *const _,
enable_smartcard.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "enable-usbredir")]
pub fn enables_usbredir(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"enable-usbredir\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `enable-usbredir` getter")
}
}
#[doc(alias = "enable-usbredir")]
pub fn set_enable_usbredir(&self, enable_usbredir: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"enable-usbredir\0".as_ptr() as *const _,
enable_usbredir.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "gl-scanout")]
pub fn is_gl_scanout(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"gl-scanout\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `gl-scanout` getter")
}
}
#[doc(alias = "gl-scanout")]
pub fn set_gl_scanout(&self, gl_scanout: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"gl-scanout\0".as_ptr() as *const _,
gl_scanout.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "glz-window-size")]
pub fn glz_window_size(&self) -> i32 {
unsafe {
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"glz-window-size\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `glz-window-size` getter")
}
}
#[doc(alias = "glz-window-size")]
pub fn set_glz_window_size(&self, glz_window_size: i32) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"glz-window-size\0".as_ptr() as *const _,
glz_window_size.to_value().to_glib_none().0,
);
}
}
pub fn host(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"host\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `host` getter")
}
}
pub fn set_host(&self, host: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"host\0".as_ptr() as *const _,
host.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "inhibit-keyboard-grab")]
pub fn is_inhibit_keyboard_grab(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"inhibit-keyboard-grab\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `inhibit-keyboard-grab` getter")
}
}
#[doc(alias = "inhibit-keyboard-grab")]
pub fn set_inhibit_keyboard_grab(&self, inhibit_keyboard_grab: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"inhibit-keyboard-grab\0".as_ptr() as *const _,
inhibit_keyboard_grab.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "migration-state")]
pub fn migration_state(&self) -> SessionMigration {
unsafe {
let mut value = glib::Value::from_type(<SessionMigration as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"migration-state\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `migration-state` getter")
}
}
pub fn name(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"name\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `name` getter")
}
}
pub fn password(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"password\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `password` getter")
}
}
pub fn set_password(&self, password: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"password\0".as_ptr() as *const _,
password.to_value().to_glib_none().0,
);
}
}
pub fn port(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"port\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `port` getter")
}
}
pub fn set_port(&self, port: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"port\0".as_ptr() as *const _,
port.to_value().to_glib_none().0,
);
}
}
pub fn protocol(&self) -> i32 {
unsafe {
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"protocol\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `protocol` getter")
}
}
pub fn set_protocol(&self, protocol: i32) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"protocol\0".as_ptr() as *const _,
protocol.to_value().to_glib_none().0,
);
}
}
pub fn proxy(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"proxy\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `proxy` getter")
}
}
pub fn set_proxy(&self, proxy: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"proxy\0".as_ptr() as *const _,
proxy.to_value().to_glib_none().0,
);
}
}
pub fn pubkey(&self) -> Option<glib::ByteArray> {
unsafe {
let mut value = glib::Value::from_type(<glib::ByteArray as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"pubkey\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `pubkey` getter")
}
}
pub fn set_pubkey(&self, pubkey: Option<&glib::ByteArray>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"pubkey\0".as_ptr() as *const _,
pubkey.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "read-only")]
pub fn set_read_only(&self, read_only: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"read-only\0".as_ptr() as *const _,
read_only.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "secure-channels")]
pub fn secure_channels(&self) -> Vec<glib::GString> {
unsafe {
let mut value =
glib::Value::from_type(<Vec<glib::GString> as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"secure-channels\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `secure-channels` getter")
}
}
#[doc(alias = "secure-channels")]
pub fn set_secure_channels(&self, secure_channels: &[&str]) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"secure-channels\0".as_ptr() as *const _,
secure_channels.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "share-dir-ro")]
pub fn is_share_dir_ro(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"share-dir-ro\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `share-dir-ro` getter")
}
}
#[doc(alias = "share-dir-ro")]
pub fn set_share_dir_ro(&self, share_dir_ro: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"share-dir-ro\0".as_ptr() as *const _,
share_dir_ro.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "shared-dir")]
pub fn shared_dir(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"shared-dir\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `shared-dir` getter")
}
}
#[doc(alias = "shared-dir")]
pub fn set_shared_dir(&self, shared_dir: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"shared-dir\0".as_ptr() as *const _,
shared_dir.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "smartcard-certificates")]
pub fn smartcard_certificates(&self) -> Vec<glib::GString> {
unsafe {
let mut value =
glib::Value::from_type(<Vec<glib::GString> as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"smartcard-certificates\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `smartcard-certificates` getter")
}
}
#[doc(alias = "smartcard-certificates")]
pub fn set_smartcard_certificates(&self, smartcard_certificates: &[&str]) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"smartcard-certificates\0".as_ptr() as *const _,
smartcard_certificates.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "smartcard-db")]
pub fn smartcard_db(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"smartcard-db\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `smartcard-db` getter")
}
}
#[doc(alias = "smartcard-db")]
pub fn set_smartcard_db(&self, smartcard_db: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"smartcard-db\0".as_ptr() as *const _,
smartcard_db.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "tls-port")]
pub fn tls_port(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"tls-port\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `tls-port` getter")
}
}
#[doc(alias = "tls-port")]
pub fn set_tls_port(&self, tls_port: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"tls-port\0".as_ptr() as *const _,
tls_port.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "unix-path")]
pub fn unix_path(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"unix-path\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `unix-path` getter")
}
}
#[doc(alias = "unix-path")]
pub fn set_unix_path(&self, unix_path: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"unix-path\0".as_ptr() as *const _,
unix_path.to_value().to_glib_none().0,
);
}
}
pub fn uri(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"uri\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().expect("Return Value for property `uri` getter")
}
}
pub fn set_uri(&self, uri: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"uri\0".as_ptr() as *const _,
uri.to_value().to_glib_none().0,
);
}
}
pub fn username(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"username\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `username` getter")
}
}
pub fn set_username(&self, username: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"username\0".as_ptr() as *const _,
username.to_value().to_glib_none().0,
);
}
}
pub fn verify(&self) -> SessionVerify {
unsafe {
let mut value = glib::Value::from_type(<SessionVerify as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"verify\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `verify` getter")
}
}
pub fn set_verify(&self, verify: SessionVerify) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"verify\0".as_ptr() as *const _,
verify.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "channel-destroy")]
pub fn connect_channel_destroy<F: Fn(&Self, &Channel) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn channel_destroy_trampoline<F: Fn(&Session, &Channel) + 'static>(
this: *mut ffi::SpiceSession,
channel: *mut ffi::SpiceChannel,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(channel))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"channel-destroy\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
channel_destroy_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "channel-new")]
pub fn connect_channel_new<F: Fn(&Self, &Channel) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn channel_new_trampoline<F: Fn(&Session, &Channel) + 'static>(
this: *mut ffi::SpiceSession,
channel: *mut ffi::SpiceChannel,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(channel))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"channel-new\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
channel_new_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "disconnected")]
pub fn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn disconnected_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"disconnected\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
disconnected_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "mm-time-reset")]
pub fn connect_mm_time_reset<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn mm_time_reset_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"mm-time-reset\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
mm_time_reset_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "ca")]
pub fn connect_ca_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ca_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::ca\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_ca_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "ca-file")]
pub fn connect_ca_file_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ca_file_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::ca-file\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_ca_file_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "cache-size")]
pub fn connect_cache_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_cache_size_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::cache-size\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_cache_size_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "cert-subject")]
pub fn connect_cert_subject_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_cert_subject_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::cert-subject\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_cert_subject_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "ciphers")]
pub fn connect_ciphers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ciphers_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::ciphers\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_ciphers_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "client-sockets")]
pub fn connect_client_sockets_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_client_sockets_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::client-sockets\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_client_sockets_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "disable-effects")]
pub fn connect_disable_effects_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_disable_effects_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::disable-effects\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_disable_effects_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "enable-audio")]
pub fn connect_enable_audio_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_audio_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::enable-audio\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_enable_audio_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "enable-smartcard")]
pub fn connect_enable_smartcard_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_smartcard_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::enable-smartcard\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_enable_smartcard_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "enable-usbredir")]
pub fn connect_enable_usbredir_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_usbredir_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::enable-usbredir\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_enable_usbredir_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "gl-scanout")]
pub fn connect_gl_scanout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_gl_scanout_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::gl-scanout\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_gl_scanout_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "glz-window-size")]
pub fn connect_glz_window_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_glz_window_size_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::glz-window-size\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_glz_window_size_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "host")]
pub fn connect_host_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_host_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::host\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_host_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "inhibit-keyboard-grab")]
pub fn connect_inhibit_keyboard_grab_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_inhibit_keyboard_grab_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::inhibit-keyboard-grab\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_inhibit_keyboard_grab_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "migration-state")]
pub fn connect_migration_state_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_migration_state_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::migration-state\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_migration_state_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "name")]
pub fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_name_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::name\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_name_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "password")]
pub fn connect_password_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_password_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::password\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_password_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "port")]
pub fn connect_port_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_port_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::port\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_port_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "protocol")]
pub fn connect_protocol_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_protocol_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::protocol\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_protocol_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "proxy")]
pub fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::proxy\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_proxy_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "pubkey")]
pub fn connect_pubkey_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_pubkey_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::pubkey\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_pubkey_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "read-only")]
pub fn connect_read_only_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_read_only_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::read-only\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_read_only_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "secure-channels")]
pub fn connect_secure_channels_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_secure_channels_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::secure-channels\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_secure_channels_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "share-dir-ro")]
pub fn connect_share_dir_ro_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_share_dir_ro_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::share-dir-ro\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_share_dir_ro_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "shared-dir")]
pub fn connect_shared_dir_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_shared_dir_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::shared-dir\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_shared_dir_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "smartcard-certificates")]
pub fn connect_smartcard_certificates_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_smartcard_certificates_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::smartcard-certificates\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_smartcard_certificates_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "smartcard-db")]
pub fn connect_smartcard_db_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_smartcard_db_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::smartcard-db\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_smartcard_db_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "tls-port")]
pub fn connect_tls_port_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_tls_port_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::tls-port\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_tls_port_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "unix-path")]
pub fn connect_unix_path_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_unix_path_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::unix-path\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_unix_path_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "uri")]
pub fn connect_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::uri\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_uri_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "username")]
pub fn connect_username_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_username_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::username\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_username_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "uuid")]
pub fn connect_uuid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_uuid_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::uuid\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_uuid_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "verify")]
pub fn connect_verify_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_verify_trampoline<F: Fn(&Session) + 'static>(
this: *mut ffi::SpiceSession,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::verify\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_verify_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl Default for Session {
fn default() -> Self {
Self::new()
}
}
impl fmt::Display for Session {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Session")
}
}