Skip to content

Conversation

@A6GibKm
Copy link
Contributor

@A6GibKm A6GibKm commented Nov 27, 2025

Generated by temporarily adding glib:get-type to the gir file, moving he
generated file to src and modifying the glib::wrapper macro.

This is based on top of #2183.

impl RenderReplay {
#[doc(alias = "gsk_render_replay_default")]
#[allow(clippy::should_implement_trait)]
pub fn default(&mut self, node: impl AsRef<RenderNode>) -> Option<RenderNode> {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think any of those need &mut self

@A6GibKm A6GibKm force-pushed the render-replay-bindings branch 2 times, most recently from 13e5bfa to 31ed695 Compare November 27, 2025 16:35
pub fn default(&self, node: impl AsRef<RenderNode>) -> Option<RenderNode> {
unsafe {
from_glib_full(ffi::gsk_render_replay_default(
self.to_glib_none_mut().0,
Copy link
Member

Choose a reason for hiding this comment

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

You no longer have access to glib::translate::*, you should do self.ptr.as_ptr() for getters and as_mut_ptr for setters (those would require &mut self)

Copy link
Contributor Author

@A6GibKm A6GibKm Nov 27, 2025

Choose a reason for hiding this comment

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

I don't think https://docs.gtk.org/gsk4/struct.RenderReplay.html has any getter and I am not sure if the non set_ methods should be mut.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I settled for leaving only set_ methods as &mut self.

@A6GibKm A6GibKm force-pushed the render-replay-bindings branch 2 times, most recently from 006fe2d to 8e972de Compare November 27, 2025 16:52
Generated by temporarily adding glib:get-type to the gir file, moving the
generated file to src and then

- Replace the glib::wrapper macro with `struct` and `impl Drop`.
- Replace from_glib_borrow with Self(ptr)
- Replace to_glib_none_mut with self.0.as_mut
@A6GibKm A6GibKm force-pushed the render-replay-bindings branch from 8e972de to 3cec3c9 Compare November 27, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants