[cairo-bugs] [Bug 26758] New: language bindings guide: clarify mapping for cairo_pattern_create_rgb[a]
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Feb 25 12:25:11 PST 2010
http://bugs.freedesktop.org/show_bug.cgi?id=26758
Summary: language bindings guide: clarify mapping for
cairo_pattern_create_rgb[a]
Product: cairo
Version: 1.9.7
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: general
AssignedTo: cworth at cworth.org
ReportedBy: otaylor at redhat.com
QAContact: cairo-bugs at cairographics.org
Created an attachment (id=33570)
--> (http://bugs.freedesktop.org/attachment.cgi?id=33570)
Patch as described
Clarify that cairo_pattern_create_rgb() and cairo_pattern_create_rgba()
should be be overloaded as a single constructor for SolidPattern, but
instead should be static methods.
===
<otaylor> cworth: any opinion whether 'new Cairo.SolidPattern(1, 0, 0)', 'new
Cairo.SolidPattern(1, 0, 0, 0)' is a good overload, or whether it should be
Cairo.SolidPattern.createRGB(1, 0,0)' ?
<cworth> otaylor: Not really. I find almost all class hierarchies entirely
inscrutable.
<cworth> otaylor: Oh, actually, I may have an opinion here.
<otaylor> cworth: fair enough. I guess the question is whether you consider it
likely that there will be cairo_pattern_create_cmyk() in the future, and if
there is, whether you would consider it an equal-peer to create_rgb() or
something rare and corner case
<cworth> Having RGB and RGBA explicit in the names does lead to more readable
code. Like, which one is the alpha channel? (recalling that we have an enum
with "ARGB" in it for example).
<jdahlin> but what should the default sold pattern constructor be mapped to? or
should it not be a default constructor?
<otaylor> jdahlin: then we wouldn't have a default constructor
<otaylor> (Note that solid patterns are sort of rare beasts to create
explicitly, so it doesn't matter if it's a bit clunky)
===
Opposite approach would be to add the two functions to the list of approved
overloads elsewhere in the language bindings guide.
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the cairo-bugs
mailing list