gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.25k stars 82 forks source link

`GtkImage::surface` property not bound #1010

Closed nt8r closed 4 years ago

nt8r commented 4 years ago

Hi,

Presently the surface property of Gtk.Image is marked with ignore = true in Gir.toml. I tried removing the ignore line and regenerating bindings, and things seem to work as expected afterward.

Gtk.CellRendererPixbuf's surface property is in the same situation. Is there a reason cairo::Surface-typed properties are currently ignored?

These properties in particular are important because they allow setting image contents with a specific scale associated, which can avoid GDK blindly upscaling and blurring raster content when at scale factor >1: see gtk#613.

sdroege commented 4 years ago

If you put cairo.Surface into the manual section in Gir.toml it should be possible to autogenerate these. I currently don't see a reason why this shouldn't be done.

Do you want to try and create a PR?

nt8r commented 4 years ago

@sdroege I don't understand--cairo.Surface is already in the manual list in Gir.toml, as far as I can tell: https://github.com/gtk-rs/gtk/blob/dfb777a1958e9376bf565903dd98d480fc4c7fe4/Gir.toml#L362

Assuming it's enough to just remove the ignore = true lines and their preceding comments, I'll submit a PR momentarily. Thanks!

sdroege commented 4 years ago

That should then be enough, yes.