Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gdk4-macos/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-macos/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-wayland/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-wayland/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-win32/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-win32/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-x11/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4-x11/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
4 changes: 2 additions & 2 deletions gdk4/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
2 changes: 1 addition & 1 deletion gir
2 changes: 1 addition & 1 deletion gir-files
8 changes: 8 additions & 0 deletions gsk4/src/auto/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,10 @@ pub enum RenderNodeType {
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "GSK_COMPOSITE_NODE")]
CompositeNode,
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "GSK_ISOLATION_NODE")]
IsolationNode,
#[doc(hidden)]
__Unknown(i32),
}
Expand Down Expand Up @@ -1534,6 +1538,8 @@ impl IntoGlib for RenderNodeType {
Self::PasteNode => ffi::GSK_PASTE_NODE,
#[cfg(feature = "v4_22")]
Self::CompositeNode => ffi::GSK_COMPOSITE_NODE,
#[cfg(feature = "v4_22")]
Self::IsolationNode => ffi::GSK_ISOLATION_NODE,
Self::__Unknown(value) => value,
}
}
Expand Down Expand Up @@ -1589,6 +1595,8 @@ impl FromGlib<ffi::GskRenderNodeType> for RenderNodeType {
ffi::GSK_PASTE_NODE => Self::PasteNode,
#[cfg(feature = "v4_22")]
ffi::GSK_COMPOSITE_NODE => Self::CompositeNode,
#[cfg(feature = "v4_22")]
ffi::GSK_ISOLATION_NODE => Self::IsolationNode,
value => Self::__Unknown(value),
}
}
Expand Down
35 changes: 35 additions & 0 deletions gsk4/src/auto/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ impl Path {
}
}

//#[cfg(feature = "v4_22")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
//#[doc(alias = "gsk_path_get_next")]
//#[doc(alias = "get_next")]
//pub fn next(&self, point: /*Unimplemented*/PathPoint) -> bool {
// unsafe { TODO: call ffi:gsk_path_get_next() }
//}

//#[cfg(feature = "v4_22")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
//#[doc(alias = "gsk_path_get_previous")]
//#[doc(alias = "get_previous")]
//pub fn previous(&self, point: /*Unimplemented*/PathPoint) -> bool {
// unsafe { TODO: call ffi:gsk_path_get_previous() }
//}

#[doc(alias = "gsk_path_get_start_point")]
#[doc(alias = "get_start_point")]
pub fn start_point(&self) -> Option<PathPoint> {
Expand Down Expand Up @@ -123,6 +139,25 @@ impl Path {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "gsk_path_get_tight_bounds")]
#[doc(alias = "get_tight_bounds")]
pub fn tight_bounds(&self) -> Option<graphene::Rect> {
unsafe {
let mut bounds = graphene::Rect::uninitialized();
let ret = from_glib(ffi::gsk_path_get_tight_bounds(
self.to_glib_none().0,
bounds.to_glib_none_mut().0,
));
if ret {
Some(bounds)
} else {
None
}
}
}

#[doc(alias = "gsk_path_in_fill")]
pub fn in_fill(&self, point: &graphene::Point, fill_rule: FillRule) -> bool {
unsafe {
Expand Down
4 changes: 2 additions & 2 deletions gsk4/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
63 changes: 63 additions & 0 deletions gsk4/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ pub const GSK_PASTE_NODE: GskRenderNodeType = 33;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub const GSK_COMPOSITE_NODE: GskRenderNodeType = 34;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub const GSK_ISOLATION_NODE: GskRenderNodeType = 35;

pub type GskScalingFilter = c_int;
pub const GSK_SCALING_FILTER_LINEAR: GskScalingFilter = 0;
Expand All @@ -195,6 +198,12 @@ pub const GSK_TRANSFORM_CATEGORY_2D_TRANSLATE: GskTransformCategory = 5;
pub const GSK_TRANSFORM_CATEGORY_IDENTITY: GskTransformCategory = 6;

// Flags
pub type GskIsolation = c_uint;
pub const GSK_ISOLATION_NONE: GskIsolation = 0;
pub const GSK_ISOLATION_BACKGROUND: GskIsolation = 1;
pub const GSK_ISOLATION_COPY_PASTE: GskIsolation = 2;
pub const GSK_ISOLATION_ALL: GskIsolation = 4294967295;

pub type GskPathForeachFlags = c_uint;
pub const GSK_PATH_FOREACH_ALLOW_ONLY_LINES: GskPathForeachFlags = 0;
pub const GSK_PATH_FOREACH_ALLOW_QUAD: GskPathForeachFlags = 1;
Expand Down Expand Up @@ -836,6 +845,20 @@ impl ::std::fmt::Debug for GskInsetShadowNode {
}
}

#[repr(C)]
#[allow(dead_code)]
pub struct GskIsolationNode {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for GskIsolationNode {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GskIsolationNode @ {self:p}"))
.finish()
}
}

#[repr(C)]
#[allow(dead_code)]
pub struct GskLinearGradientNode {
Expand Down Expand Up @@ -1224,6 +1247,13 @@ extern "C" {
//=========================================================================
pub fn gsk_transform_category_get_type() -> GType;

//=========================================================================
// GskIsolation
//=========================================================================
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_isolation_get_type() -> GType;

//=========================================================================
// GskPathForeachFlags
//=========================================================================
Expand Down Expand Up @@ -1320,6 +1350,12 @@ extern "C" {
#[cfg(feature = "v4_14")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
pub fn gsk_path_get_end_point(self_: *mut GskPath, result: *mut GskPathPoint) -> gboolean;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_path_get_next(self_: *mut GskPath, point: *mut GskPathPoint) -> gboolean;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_path_get_previous(self_: *mut GskPath, point: *mut GskPathPoint) -> gboolean;
#[cfg(feature = "v4_14")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
pub fn gsk_path_get_start_point(self_: *mut GskPath, result: *mut GskPathPoint) -> gboolean;
Expand All @@ -1330,6 +1366,12 @@ extern "C" {
stroke: *const GskStroke,
bounds: *mut graphene::graphene_rect_t,
) -> gboolean;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_path_get_tight_bounds(
self_: *mut GskPath,
bounds: *mut graphene::graphene_rect_t,
) -> gboolean;
#[cfg(feature = "v4_14")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
pub fn gsk_path_in_fill(
Expand Down Expand Up @@ -2136,6 +2178,8 @@ extern "C" {
//=========================================================================
// GskCompositeNode
//=========================================================================
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_composite_node_get_type() -> GType;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
Expand Down Expand Up @@ -2366,6 +2410,25 @@ extern "C" {
) -> *const GskRoundedRect;
pub fn gsk_inset_shadow_node_get_spread(node: *const GskInsetShadowNode) -> c_float;

//=========================================================================
// GskIsolationNode
//=========================================================================
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_isolation_node_get_type() -> GType;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_isolation_node_new(
child: *mut GskRenderNode,
isolations: GskIsolation,
) -> *mut GskIsolationNode;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_isolation_node_get_child(node: *const GskIsolationNode) -> *mut GskRenderNode;
#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn gsk_isolation_node_get_isolations(node: *const GskIsolationNode) -> GskIsolation;

//=========================================================================
// GskLinearGradientNode
//=========================================================================
Expand Down
12 changes: 12 additions & 0 deletions gsk4/sys/tests/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[
alignment: align_of::<GskGLUniformType>(),
},
),
(
"GskIsolation",
Layout {
size: size_of::<GskIsolation>(),
alignment: align_of::<GskIsolation>(),
},
),
(
"GskLineCap",
Layout {
Expand Down Expand Up @@ -405,6 +412,11 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
("(gint) GSK_GL_UNIFORM_TYPE_VEC3", "6"),
("(gint) GSK_GL_UNIFORM_TYPE_VEC4", "7"),
("(gint) GSK_INSET_SHADOW_NODE", "11"),
("(guint) GSK_ISOLATION_ALL", "4294967295"),
("(guint) GSK_ISOLATION_BACKGROUND", "1"),
("(guint) GSK_ISOLATION_COPY_PASTE", "2"),
("(gint) GSK_ISOLATION_NODE", "35"),
("(guint) GSK_ISOLATION_NONE", "0"),
("(gint) GSK_LINEAR_GRADIENT_NODE", "4"),
("(gint) GSK_LINE_CAP_BUTT", "0"),
("(gint) GSK_LINE_CAP_ROUND", "1"),
Expand Down
5 changes: 5 additions & 0 deletions gsk4/sys/tests/constant.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ int main() {
PRINT_CONSTANT((gint) GSK_GL_UNIFORM_TYPE_VEC3);
PRINT_CONSTANT((gint) GSK_GL_UNIFORM_TYPE_VEC4);
PRINT_CONSTANT((gint) GSK_INSET_SHADOW_NODE);
PRINT_CONSTANT((guint) GSK_ISOLATION_ALL);
PRINT_CONSTANT((guint) GSK_ISOLATION_BACKGROUND);
PRINT_CONSTANT((guint) GSK_ISOLATION_COPY_PASTE);
PRINT_CONSTANT((gint) GSK_ISOLATION_NODE);
PRINT_CONSTANT((guint) GSK_ISOLATION_NONE);
PRINT_CONSTANT((gint) GSK_LINEAR_GRADIENT_NODE);
PRINT_CONSTANT((gint) GSK_LINE_CAP_BUTT);
PRINT_CONSTANT((gint) GSK_LINE_CAP_ROUND);
Expand Down
1 change: 1 addition & 0 deletions gsk4/sys/tests/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ int main() {
printf("%s;%zu;%zu\n", "GskFillRule", sizeof(GskFillRule), alignof(GskFillRule));
printf("%s;%zu;%zu\n", "GskGLShaderClass", sizeof(GskGLShaderClass), alignof(GskGLShaderClass));
printf("%s;%zu;%zu\n", "GskGLUniformType", sizeof(GskGLUniformType), alignof(GskGLUniformType));
printf("%s;%zu;%zu\n", "GskIsolation", sizeof(GskIsolation), alignof(GskIsolation));
printf("%s;%zu;%zu\n", "GskLineCap", sizeof(GskLineCap), alignof(GskLineCap));
printf("%s;%zu;%zu\n", "GskLineJoin", sizeof(GskLineJoin), alignof(GskLineJoin));
printf("%s;%zu;%zu\n", "GskMaskMode", sizeof(GskMaskMode), alignof(GskMaskMode));
Expand Down
4 changes: 2 additions & 2 deletions gsk4/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 1d0088ebcb66)
from gir-files (https://github.com/gtk-rs/gir-files @ 6715d605e539)
Generated by gir (https://github.com/gtk-rs/gir @ 65b693752cd9)
from gir-files (https://github.com/gtk-rs/gir-files @ ef7c8d351e57)
53 changes: 53 additions & 0 deletions gtk4/src/auto/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ impl Picture {
unsafe { from_glib_none(ffi::gtk_picture_get_file(self.to_glib_none().0)) }
}

#[doc(alias = "gtk_picture_get_isolate_contents")]
#[doc(alias = "get_isolate_contents")]
#[doc(alias = "isolate-contents")]
pub fn is_isolate_contents(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs since

unsafe { from_glib(ffi::gtk_picture_get_isolate_contents(self.to_glib_none().0)) }
}

#[cfg_attr(feature = "v4_8", deprecated = "Since 4.8")]
#[allow(deprecated)]
#[doc(alias = "gtk_picture_get_keep_aspect_ratio")]
Expand Down Expand Up @@ -199,6 +206,19 @@ impl Picture {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "gtk_picture_set_isolate_contents")]
#[doc(alias = "isolate-contents")]
pub fn set_isolate_contents(&self, isolate_contents: bool) {
unsafe {
ffi::gtk_picture_set_isolate_contents(
self.to_glib_none().0,
isolate_contents.into_glib(),
);
}
}

#[cfg_attr(feature = "v4_8", deprecated = "Since 4.8")]
#[allow(deprecated)]
#[doc(alias = "gtk_picture_set_keep_aspect_ratio")]
Expand Down Expand Up @@ -333,6 +353,31 @@ impl Picture {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
#[doc(alias = "isolate-contents")]
pub fn connect_isolate_contents_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_isolate_contents_trampoline<F: Fn(&Picture) + 'static>(
this: *mut ffi::GtkPicture,
_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 _,
c"notify::isolate-contents".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_isolate_contents_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}

#[cfg_attr(feature = "v4_8", deprecated = "Since 4.8")]
#[doc(alias = "keep-aspect-ratio")]
pub fn connect_keep_aspect_ratio_notify<F: Fn(&Self) + 'static>(
Expand Down Expand Up @@ -434,6 +479,14 @@ impl PictureBuilder {
}
}

#[cfg(feature = "v4_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
pub fn isolate_contents(self, isolate_contents: bool) -> Self {
Self {
builder: self.builder.property("isolate-contents", isolate_contents),
}
}

#[cfg_attr(feature = "v4_8", deprecated = "Since 4.8")]
pub fn keep_aspect_ratio(self, keep_aspect_ratio: bool) -> Self {
Self {
Expand Down
Loading