After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622324 - gdk_pixbuf_format_is_writable()
gdk_pixbuf_format_is_writable()
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2010-06-21 21:55 UTC by Kevin Ryde
Modified: 2010-11-27 14:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch and test case (2.20 KB, patch)
2010-06-21 21:55 UTC, Kevin Ryde
none Details | Review
patch and test case (2.87 KB, patch)
2010-11-24 22:15 UTC, Kevin Ryde
committed Details | Review

Description Kevin Ryde 2010-06-21 21:55:21 UTC
Created attachment 164253 [details] [review]
patch and test case

I wanted to know if a GdkPixbuf file format is writable.  Is that already hiding in the Gtk2::Gdk::PixbufFormat hash somewhere?  If not then perhaps gdk_pixbuf_format_is_writable() per attached.
Comment 1 Torsten Schoenfeld 2010-11-23 21:55:51 UTC
Looks like an oversight.  But the functions gdk_pixbuf_format_is_scalable and gdk_pixbuf_format_is_disabled are handled by putting a corresponding entry into the format hash.  Why not handle gdk_pixbuf_format_is_writable similarly?
Comment 2 Kevin Ryde 2010-11-23 22:39:46 UTC
I wondered that copying fields to the hash might not be a great idea.  A touch wasteful doing it every time an object reaches the perl level, and the bit about is_disabled in principle changing by set_disabled.

I don't mind too much either way.  A hash field might be more consistent with the other info coming out.
Comment 3 Torsten Schoenfeld 2010-11-24 19:54:55 UTC
I agree that the hash representation is not optimal, but we can't change that now.  So I'd prefer an implementation of is_writable as a key in the format hash.

Of course you could go really fancy and turn the hash into a tied hash that calls the real accessors under the hood.  That would also solve the is_disabled problem.  See Cairo/CairoPath.xs for an example of an XS implementation of a tied array.
Comment 4 Kevin Ryde 2010-11-24 22:15:41 UTC
Created attachment 175206 [details] [review]
patch and test case

This one as an is_writable field.
Comment 5 Torsten Schoenfeld 2010-11-27 14:29:11 UTC
Looks good, especially the POD addition.  Committed.  Thanks.