gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!

Home Page:https://gtk-rs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`GtkImage::surface` property not bound

nt8r opened this issue · comments

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.

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?

@sdroege I don't understand--cairo.Surface is already in the manual list in Gir.toml, as far as I can tell:

gtk/Gir.toml

Line 362 in dfb777a

"cairo.Surface",

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

That should then be enough, yes.