Skip to content

Commit 17a97fa

Browse files
authored
Merge pull request #1719 from gtk-rs/auto-pr-branch
Automated PR: Changes from updating gir/gir-files
2 parents b5f93cb + 59d7a17 commit 17a97fa

34 files changed

+768
-36
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true }
2525
- { name: "gio", features: "v2_84", nightly: "--all-features", test_sys: true }
2626
- { name: "glib", features: "v2_84,log", nightly: "--all-features", test_sys: true }
27-
- { name: "graphene", features: "", nightly: "", test_sys: true }
27+
- { name: "graphene", features: "v1_12", nightly: "", test_sys: true }
2828
- { name: "pango", features: "v1_56", nightly: "--all-features", test_sys: true }
2929
- { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true }
3030
steps:

gdk-pixbuf/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

gdk-pixbuf/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

gio/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

gio/src/auto/zlib_compressor.rs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ impl ZlibCompressor {
3232
unsafe { from_glib_none(ffi::g_zlib_compressor_get_file_info(self.to_glib_none().0)) }
3333
}
3434

35+
#[cfg(feature = "v2_86")]
36+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
37+
#[doc(alias = "g_zlib_compressor_get_os")]
38+
#[doc(alias = "get_os")]
39+
pub fn os(&self) -> i32 {
40+
unsafe { ffi::g_zlib_compressor_get_os(self.to_glib_none().0) }
41+
}
42+
3543
#[doc(alias = "g_zlib_compressor_set_file_info")]
3644
#[doc(alias = "file-info")]
3745
pub fn set_file_info(&self, file_info: Option<&FileInfo>) {
@@ -40,6 +48,16 @@ impl ZlibCompressor {
4048
}
4149
}
4250

51+
#[cfg(feature = "v2_86")]
52+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
53+
#[doc(alias = "g_zlib_compressor_set_os")]
54+
#[doc(alias = "os")]
55+
pub fn set_os(&self, os: i32) {
56+
unsafe {
57+
ffi::g_zlib_compressor_set_os(self.to_glib_none().0, os);
58+
}
59+
}
60+
4361
pub fn format(&self) -> ZlibCompressorFormat {
4462
ObjectExt::property(self, "format")
4563
}
@@ -70,4 +88,29 @@ impl ZlibCompressor {
7088
)
7189
}
7290
}
91+
92+
#[cfg(feature = "v2_86")]
93+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
94+
#[doc(alias = "os")]
95+
pub fn connect_os_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
96+
unsafe extern "C" fn notify_os_trampoline<F: Fn(&ZlibCompressor) + 'static>(
97+
this: *mut ffi::GZlibCompressor,
98+
_param_spec: glib::ffi::gpointer,
99+
f: glib::ffi::gpointer,
100+
) {
101+
let f: &F = &*(f as *const F);
102+
f(&from_glib_borrow(this))
103+
}
104+
unsafe {
105+
let f: Box_<F> = Box_::new(f);
106+
connect_raw(
107+
self.as_ptr() as *mut _,
108+
c"notify::os".as_ptr() as *const _,
109+
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
110+
notify_os_trampoline::<F> as *const (),
111+
)),
112+
Box_::into_raw(f),
113+
)
114+
}
115+
}
73116
}

gio/sys/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15040,10 +15040,16 @@ extern "C" {
1504015040
level: c_int,
1504115041
) -> *mut GZlibCompressor;
1504215042
pub fn g_zlib_compressor_get_file_info(compressor: *mut GZlibCompressor) -> *mut GFileInfo;
15043+
#[cfg(feature = "v2_86")]
15044+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
15045+
pub fn g_zlib_compressor_get_os(compressor: *mut GZlibCompressor) -> c_int;
1504315046
pub fn g_zlib_compressor_set_file_info(
1504415047
compressor: *mut GZlibCompressor,
1504515048
file_info: *mut GFileInfo,
1504615049
);
15050+
#[cfg(feature = "v2_86")]
15051+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
15052+
pub fn g_zlib_compressor_set_os(compressor: *mut GZlibCompressor, os: c_int);
1504715053

1504815054
//=========================================================================
1504915055
// GZlibDecompressor

gio/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

glib/Gir.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,17 @@ concurrency = "send+sync"
837837
# parameter type
838838
ignore = true
839839

840+
[[object.function]]
841+
name = "dup_context"
842+
# implemented as the normal getter
843+
manual = true
844+
845+
[[object.function]]
846+
name = "get_context"
847+
# implemented conditionally around this or
848+
# dup_context() (see above)
849+
manual = true
850+
840851
[[object]]
841852
name = "GLib.ThreadPool"
842853
status = "manual"

glib/gobject-sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

glib/src/auto/source.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// from gir-files (https://github.com/gtk-rs/gir-files)
33
// DO NOT EDIT
44

5-
use crate::{ffi, translate::*, MainContext};
5+
use crate::{ffi, translate::*};
66

77
crate::wrapper! {
88
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -51,12 +51,6 @@ impl Source {
5151
unsafe { from_glib(ffi::g_source_get_can_recurse(self.to_glib_none().0)) }
5252
}
5353

54-
#[doc(alias = "g_source_get_context")]
55-
#[doc(alias = "get_context")]
56-
pub fn context(&self) -> Option<MainContext> {
57-
unsafe { from_glib_none(ffi::g_source_get_context(self.to_glib_none().0)) }
58-
}
59-
6054
#[doc(alias = "g_source_get_name")]
6155
#[doc(alias = "get_name")]
6256
pub fn name(&self) -> Option<crate::GString> {

glib/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

glib/src/source.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,4 +1270,18 @@ impl Source {
12701270
))
12711271
}
12721272
}
1273+
1274+
#[doc(alias = "g_source_get_context")]
1275+
#[doc(alias = "get_context")]
1276+
#[doc(alias = "g_source_dup_context")]
1277+
pub fn context(&self) -> Option<MainContext> {
1278+
#[cfg(feature = "v2_86")]
1279+
unsafe {
1280+
from_glib_full(ffi::g_source_dup_context(self.to_glib_none().0))
1281+
}
1282+
#[cfg(not(feature = "v2_86"))]
1283+
unsafe {
1284+
from_glib_none(ffi::g_source_get_context(self.to_glib_none().0))
1285+
}
1286+
}
12731287
}

glib/sys/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5147,6 +5147,9 @@ extern "C" {
51475147
pub fn g_source_add_unix_fd(source: *mut GSource, fd: c_int, events: GIOCondition) -> gpointer;
51485148
pub fn g_source_attach(source: *mut GSource, context: *mut GMainContext) -> c_uint;
51495149
pub fn g_source_destroy(source: *mut GSource);
5150+
#[cfg(feature = "v2_86")]
5151+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
5152+
pub fn g_source_dup_context(source: *mut GSource) -> *mut GMainContext;
51505153
pub fn g_source_get_can_recurse(source: *mut GSource) -> gboolean;
51515154
pub fn g_source_get_context(source: *mut GSource) -> *mut GMainContext;
51525155
pub fn g_source_get_current_time(source: *mut GSource, timeval: *mut GTimeVal);

glib/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b)
1+
Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7)

graphene/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ version.workspace = true
1717
name = "graphene"
1818

1919
[features]
20+
v1_12 = ["graphene-sys/v1_12"]
2021

2122
[dependencies]
2223
graphene-sys.workspace = true

graphene/Gir.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,46 @@ boxed_inline = true
5454
# float array
5555
manual = true
5656

57+
[[object]]
58+
name = "Graphene.Box2D"
59+
status = "generate"
60+
boxed_inline = true
61+
[[object.function]]
62+
# contents undefined
63+
name = "alloc"
64+
ignore = true
65+
[[object.function]]
66+
name = "init_from_box"
67+
ignore = true # Copy like constructor
68+
[[object.function]]
69+
name = "init"
70+
manual = true # manual proper constructor
71+
rename = "new"
72+
[[object.function]]
73+
name = "init_from_points"
74+
manual = true # manual proper constructor
75+
rename = "from_points"
76+
[[object.function]]
77+
name = "init_from_vec2"
78+
manual = true # manual proper constructor
79+
rename = "from_vec2"
80+
[[object.function]]
81+
name = "init_from_rect"
82+
manual = true # manual proper constructor
83+
rename = "from_rect"
84+
[[object.function]]
85+
name = "init_from_vectors"
86+
manual = true # manual proper constructor
87+
rename = "from_vectors"
88+
[[object.function]]
89+
name = "get_vertices"
90+
# float array
91+
manual = true
92+
[[object.function]]
93+
name = "to_float"
94+
# float array
95+
manual = true
96+
5797
[[object]]
5898
name = "Graphene.Euler"
5999
status = "generate"

0 commit comments

Comments
 (0)