Updated cairo bindings on dsource
renox
renosky at free.fr
Fri May 19 14:34:36 PDT 2006
Daniel Keep wrote:
> I've just updated the cairo bindings on dsource. Changes included:
>
> * Several bugfixes.
> * Addition of the Glitz and Xlib backends.
> * New OO layer called cairooo.
> * cairooo snippets.
> * A very *very* basic cairooo tutorial.
> * A neat little demo program, which renders one of FunkyM's D logos in
> various styles.
> * D scripts for building import libraries.
>
> http://dsource.org/projects/bindings/browser/trunk/cairo
>
> Also, if anyone is interested, I'd like to get some eyes other than my
> own on to the design of the OO layer; this is my first attempt at
> putting together something this large.
>
> Specifically, I have a few classes that can't decide between using
> constructors or static methods. The problem is this:
>
> * Certain objects can be constructed in different ways. For example:
> SolidPattern can be created using an RGB or RGBA colour.
>
> * However, the cairo developers have said NOT to overload these methods,
> since RGBA using premultiplied alpha might be added; and what if CMYK
> gets added as well?
>
> * Thus, my choices are to make a ludicrous number of subclasses so that
> I can have distinct constructors,
>
> * OR I can use static createXXX methods (which is basically what
> cairomm, C++'s binding does).
>
> For example:
>
> Pattern red = new SolidPatternRGB(1,0,0);
>
> versus:
>
> Pattern red = SolidPattern.createRGB(1,0,0);
>
> I'm leaning towards using the createXXX functions since it creates less
> clutter and useless "constructor" classes, but I'm worried that this
> will make the library inconsistent.
Why do you mean by inconsistent?
Just curious..
Regards,
Renaud Hebert.
> Or maybe I should keep as much of
> it using constructors and only use createXXX where neccecary.
>
> Ideas? Opinions? Suggestions?
>
> -- Daniel Keep
>
More information about the Digitalmars-d-announce
mailing list