[Mono-dev] [PATCH] Mono.Cairo overhaul (Was: Cairo SIGSEGV)

Idan Gazit idan at fastmail.fm
Sun Nov 6 20:50:14 EST 2005


Hi All,

So having dug a little into the Mono.Cairo stuff I can safely declare
that it needs loving.

To that end, here is my first patch. A concise list of changes is a
little further down, but basically it all started with some things being
passed by value instead of by reference, leading to segfaults. The bulk
of the changes have to do with CairoAPI &  Matrix this time around,
however Surface, Pattern, and Graphics all need more love and polish.

I have tested all of the samples in png/ and gtk/ dirs against this
patch, they all build and run successfully, with the exception of
circles.cs (seems to draw a blank surface, but it did that with the old
Mono.Cairo too, so at least it's "consistent"). However, there are some
API changes that might not be touched upon in the samples. I will try to
produce a method signature changelog for tomorrow, documenting these
changes.

I'll keep going with the goal of making a cleaner set of API bindings.
I'd like to get 100% coverage of cairo for Mono, I think it's eminently
doable. :)

Documentation updates are *NOT* in this patch, I will do them tomorrow,
hopefully this will still allow inclusion in 1.1.10. :)

Comments and criticism always always always welcome.

- Idan



Changes
=======

Matrix:
* Removed Matrix_T struct and associated properties,
* Added ==, != operators
* Implemented ICloneable
* Overrode Equals, GetHashcode()
* Made constructors a little simpler; added static Identity property.
New matrices are constructed as the identity matrix.
* Most operations modify the current matrix as well as returning itself,
so as to allow myMatrix.Translate(x,y).Scale(sx,sy)... chaining.

CairoAPI:
* fix out/ref issues (segfaulting)

Graphics:
* convert [Inverse]Transform(Point/Distance) properties to methods so
you can transform arbitrary points/distances.
* added Transform (Matrix m)
* fixed Matrix {get; set;} to use updated CairoAPI.
* fixed FontSetMatrix (this should be made into a property for consistency)

Pattern:
* fixed Matrix {get; set;} to use updated CairoAPI.

Everywhere:
* Formatting according to mono style guide wherever I was already
modifying a line anyways.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo.patch
Type: text/x-patch
Size: 18192 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051107/d7c29965/attachment.bin 


More information about the Mono-devel-list mailing list