Skip to content

Commit 6ac8cfd

Browse files
committed
Add new classes from glib 2.72
1 parent 3561ccf commit 6ac8cfd

File tree

27 files changed

+639
-17
lines changed

27 files changed

+639
-17
lines changed

gdk-pixbuf/src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ e0d8d8d645b1)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 951202c4b7fd)

gdk-pixbuf/sys/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ e0d8d8d645b1)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 951202c4b7fd)

gio/Gir.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ generate = [
5151
"Gio.DBusServerFlags",
5252
"Gio.DBusSignalFlags",
5353
"Gio.DBusSignalInfo",
54+
"Gio.DebugController",
5455
"Gio.Drive",
5556
"Gio.DriveStartFlags",
5657
"Gio.DriveStartStopType",
@@ -553,6 +554,15 @@ status = "generate"
553554
name = "no_match_rule"
554555
version = "2.70"
555556

557+
[[object]]
558+
name = "Gio.DebugControllerDBus"
559+
status = "generate"
560+
manual_traits = ["DebugControllerDBusExtManual"]
561+
[[object.property]]
562+
name = "connection"
563+
manual = true
564+
doc_trait_name = "DebugControllerDBusExtManual"
565+
556566
[[object]]
557567
name = "Gio.DesktopAppInfo"
558568
status = "generate"

gio/src/auto/debug_controller.rs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// This file was generated by gir (https://github.com/gtk-rs/gir)
2+
// from gir-files (https://github.com/gtk-rs/gir-files)
3+
// DO NOT EDIT
4+
5+
use crate::Initable;
6+
use glib::object::Cast;
7+
use glib::object::IsA;
8+
use glib::signal::connect_raw;
9+
use glib::signal::SignalHandlerId;
10+
use glib::translate::*;
11+
use std::boxed::Box as Box_;
12+
use std::fmt;
13+
use std::mem::transmute;
14+
15+
glib::wrapper! {
16+
#[doc(alias = "GDebugController")]
17+
pub struct DebugController(Interface<ffi::GDebugController, ffi::GDebugControllerInterface>) @requires Initable;
18+
19+
match fn {
20+
type_ => || ffi::g_debug_controller_get_type(),
21+
}
22+
}
23+
24+
impl DebugController {
25+
pub const NONE: Option<&'static DebugController> = None;
26+
}
27+
28+
pub trait DebugControllerExt: 'static {
29+
#[doc(alias = "g_debug_controller_get_debug_enabled")]
30+
#[doc(alias = "get_debug_enabled")]
31+
fn is_debug_enabled(&self) -> bool;
32+
33+
#[doc(alias = "g_debug_controller_set_debug_enabled")]
34+
fn set_debug_enabled(&self, debug_enabled: bool);
35+
36+
#[cfg(any(feature = "v2_72", feature = "dox"))]
37+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
38+
#[doc(alias = "debug-enabled")]
39+
fn connect_debug_enabled_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
40+
}
41+
42+
impl<O: IsA<DebugController>> DebugControllerExt for O {
43+
fn is_debug_enabled(&self) -> bool {
44+
unsafe {
45+
from_glib(ffi::g_debug_controller_get_debug_enabled(
46+
self.as_ref().to_glib_none().0,
47+
))
48+
}
49+
}
50+
51+
fn set_debug_enabled(&self, debug_enabled: bool) {
52+
unsafe {
53+
ffi::g_debug_controller_set_debug_enabled(
54+
self.as_ref().to_glib_none().0,
55+
debug_enabled.into_glib(),
56+
);
57+
}
58+
}
59+
60+
#[cfg(any(feature = "v2_72", feature = "dox"))]
61+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
62+
fn connect_debug_enabled_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
63+
unsafe extern "C" fn notify_debug_enabled_trampoline<
64+
P: IsA<DebugController>,
65+
F: Fn(&P) + 'static,
66+
>(
67+
this: *mut ffi::GDebugController,
68+
_param_spec: glib::ffi::gpointer,
69+
f: glib::ffi::gpointer,
70+
) {
71+
let f: &F = &*(f as *const F);
72+
f(DebugController::from_glib_borrow(this).unsafe_cast_ref())
73+
}
74+
unsafe {
75+
let f: Box_<F> = Box_::new(f);
76+
connect_raw(
77+
self.as_ptr() as *mut _,
78+
b"notify::debug-enabled\0".as_ptr() as *const _,
79+
Some(transmute::<_, unsafe extern "C" fn()>(
80+
notify_debug_enabled_trampoline::<Self, F> as *const (),
81+
)),
82+
Box_::into_raw(f),
83+
)
84+
}
85+
}
86+
}
87+
88+
impl fmt::Display for DebugController {
89+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
90+
f.write_str("DebugController")
91+
}
92+
}

gio/src/auto/debug_controller_dbus.rs

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// This file was generated by gir (https://github.com/gtk-rs/gir)
2+
// from gir-files (https://github.com/gtk-rs/gir-files)
3+
// DO NOT EDIT
4+
5+
use crate::Cancellable;
6+
use crate::DBusConnection;
7+
use crate::DBusMethodInvocation;
8+
use crate::DebugController;
9+
use crate::Initable;
10+
use glib::object::Cast;
11+
use glib::object::IsA;
12+
use glib::signal::connect_raw;
13+
use glib::signal::SignalHandlerId;
14+
use glib::translate::*;
15+
use std::boxed::Box as Box_;
16+
use std::fmt;
17+
use std::mem::transmute;
18+
use std::ptr;
19+
20+
glib::wrapper! {
21+
#[doc(alias = "GDebugControllerDBus")]
22+
pub struct DebugControllerDBus(Object<ffi::GDebugControllerDBus, ffi::GDebugControllerDBusClass>) @implements DebugController, Initable;
23+
24+
match fn {
25+
type_ => || ffi::g_debug_controller_dbus_get_type(),
26+
}
27+
}
28+
29+
impl DebugControllerDBus {
30+
pub const NONE: Option<&'static DebugControllerDBus> = None;
31+
32+
#[doc(alias = "g_debug_controller_dbus_new")]
33+
pub fn new(
34+
connection: &DBusConnection,
35+
cancellable: Option<&impl IsA<Cancellable>>,
36+
) -> Result<Option<DebugControllerDBus>, glib::Error> {
37+
unsafe {
38+
let mut error = ptr::null_mut();
39+
let ret = ffi::g_debug_controller_dbus_new(
40+
connection.to_glib_none().0,
41+
cancellable.map(|p| p.as_ref()).to_glib_none().0,
42+
&mut error,
43+
);
44+
if error.is_null() {
45+
Ok(from_glib_full(ret))
46+
} else {
47+
Err(from_glib_full(error))
48+
}
49+
}
50+
}
51+
}
52+
53+
pub trait DebugControllerDBusExt: 'static {
54+
#[doc(alias = "g_debug_controller_dbus_stop")]
55+
fn stop(&self);
56+
57+
#[cfg(any(feature = "v2_72", feature = "dox"))]
58+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
59+
#[doc(alias = "authorize")]
60+
fn connect_authorize<F: Fn(&Self, &DBusMethodInvocation) -> bool + 'static>(
61+
&self,
62+
f: F,
63+
) -> SignalHandlerId;
64+
}
65+
66+
impl<O: IsA<DebugControllerDBus>> DebugControllerDBusExt for O {
67+
fn stop(&self) {
68+
unsafe {
69+
ffi::g_debug_controller_dbus_stop(self.as_ref().to_glib_none().0);
70+
}
71+
}
72+
73+
#[cfg(any(feature = "v2_72", feature = "dox"))]
74+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
75+
fn connect_authorize<F: Fn(&Self, &DBusMethodInvocation) -> bool + 'static>(
76+
&self,
77+
f: F,
78+
) -> SignalHandlerId {
79+
unsafe extern "C" fn authorize_trampoline<
80+
P: IsA<DebugControllerDBus>,
81+
F: Fn(&P, &DBusMethodInvocation) -> bool + 'static,
82+
>(
83+
this: *mut ffi::GDebugControllerDBus,
84+
invocation: *mut ffi::GDBusMethodInvocation,
85+
f: glib::ffi::gpointer,
86+
) -> glib::ffi::gboolean {
87+
let f: &F = &*(f as *const F);
88+
f(
89+
DebugControllerDBus::from_glib_borrow(this).unsafe_cast_ref(),
90+
&from_glib_borrow(invocation),
91+
)
92+
.into_glib()
93+
}
94+
unsafe {
95+
let f: Box_<F> = Box_::new(f);
96+
connect_raw(
97+
self.as_ptr() as *mut _,
98+
b"authorize\0".as_ptr() as *const _,
99+
Some(transmute::<_, unsafe extern "C" fn()>(
100+
authorize_trampoline::<Self, F> as *const (),
101+
)),
102+
Box_::into_raw(f),
103+
)
104+
}
105+
}
106+
}
107+
108+
impl fmt::Display for DebugControllerDBus {
109+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
110+
f.write_str("DebugControllerDBus")
111+
}
112+
}

gio/src/auto/mod.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,20 @@ pub use self::data_input_stream::DataInputStream;
9595
mod data_output_stream;
9696
pub use self::data_output_stream::DataOutputStream;
9797

98+
#[cfg(any(feature = "v2_72", feature = "dox"))]
99+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
100+
mod debug_controller;
101+
#[cfg(any(feature = "v2_72", feature = "dox"))]
102+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
103+
pub use self::debug_controller::DebugController;
104+
105+
#[cfg(any(feature = "v2_72", feature = "dox"))]
106+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
107+
mod debug_controller_dbus;
108+
#[cfg(any(feature = "v2_72", feature = "dox"))]
109+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
110+
pub use self::debug_controller_dbus::DebugControllerDBus;
111+
98112
#[cfg(any(all(not(windows), not(target_os = "macos")), feature = "dox"))]
99113
#[cfg_attr(feature = "dox", doc(cfg(all(not(windows), not(target_os = "macos")))))]
100114
mod desktop_app_info;
@@ -686,6 +700,12 @@ pub mod traits {
686700
pub use super::dbus_interface_skeleton::DBusInterfaceSkeletonExt;
687701
pub use super::dbus_object::DBusObjectExt;
688702
pub use super::dbus_proxy::DBusProxyExt;
703+
#[cfg(any(feature = "v2_72", feature = "dox"))]
704+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
705+
pub use super::debug_controller::DebugControllerExt;
706+
#[cfg(any(feature = "v2_72", feature = "dox"))]
707+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
708+
pub use super::debug_controller_dbus::DebugControllerDBusExt;
689709
pub use super::drive::DriveExt;
690710
pub use super::emblemed_icon::EmblemedIconExt;
691711
pub use super::file::FileExt;

gio/src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ e0d8d8d645b1)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 951202c4b7fd)

gio/src/debug_controller_dbus.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Take a look at the license at the top of the repository in the LICENSE file.
2+
3+
use crate::DBusConnection;
4+
use crate::DebugControllerDBus;
5+
use glib::object::IsA;
6+
7+
pub trait DebugControllerDBusExtManual: Sized {
8+
fn connection(&self) -> DBusConnection;
9+
}
10+
11+
impl<O: IsA<DebugControllerDBus>> DebugControllerDBusExtManual for O {
12+
fn connection(&self) -> DBusConnection {
13+
glib::ObjectExt::property(self.as_ref(), "connection")
14+
}
15+
}

gio/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ pub use self::dbus_connection::{
2727
};
2828
mod dbus_message;
2929
mod dbus_method_invocation;
30+
#[cfg(any(feature = "v2_72", feature = "dox"))]
31+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
32+
mod debug_controller_dbus;
3033
#[cfg(any(all(not(windows), not(target_os = "macos")), feature = "dox"))]
3134
mod desktop_app_info;
3235
mod error;

gio/src/prelude.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ pub use crate::application::*;
1414
pub use crate::converter::*;
1515
pub use crate::data_input_stream::DataInputStreamExtManual;
1616
pub use crate::dbus_proxy::DBusProxyExtManual;
17+
#[cfg(any(feature = "v2_72", feature = "dox"))]
18+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
19+
pub use crate::debug_controller_dbus::DebugControllerDBusExtManual;
1720
#[cfg(any(feature = "v2_58", feature = "dox"))]
1821
#[cfg(any(all(not(windows), not(target_os = "macos")), feature = "dox"))]
1922
pub use crate::desktop_app_info::DesktopAppInfoExtManual;

0 commit comments

Comments
 (0)