[Mono-devel-list] S.D.gdiplus implementation

Duncan Mak duncan at ximian.com
Wed Jan 28 02:32:32 EST 2004


Hola!

I want to post a follow-up and a bit clarifications here.

On Wed, 2004-01-28 at 01:57, Ravindra wrote:
> Recently, there was a discussion among us on IRC. Thanks to Peter for
> providing us lots of useful information. We had a common opinion that
> current gdiplus implementation in S.D is not clean and it might become
> difficult to maintain as it will grow.

It's not the entire libgdiplus implementation is not clean, it's only
the Brush-family of classes that has been implemented in a hack, that's
it.

Currently, we only have two Brush classes. Brush and SolidBrush. Brush
is  an abstract class, however, we only had one concrete implementation
(SolidBrush), so we didn't taken care of handling inheritance at all and
defined Brush = SolidBrush, which is definitely a problem as we start to
implement more Brushes, obviously.

And that's why:

> So, we all thought that it would be better to use Object-oriented C approach instead, 
> where we can have class like structure. We can do something similar to inheritance, e.g.,
> struct typedef {int Brushtype;} GpBrush;
> struct typedef {GpBrush* brush; int color;} GpSolidBrush;

> It would result in code changes but existing code is not too big to
> modify. So, that should not be an issue.

With only one implementation, we will not be ripping out a lot of code.

> Now, there might be other issues like implementing virtual functions or
> something else. I don't know, if this approach could lead to any severe
> problems. 

I was initially a bit reluctant to do the full vtable/inheritance thing
in C, because I'm not a very experienced C programmer. Having talked
with pdb about this a few nights ago, I feel a lot more confident about
this now. With new hackers joining the team (Hello Jordi!), hopefully
we'll not get stuck in some big problems/regressions. On top of that,
this Brush thing *is* really an abstract class, so we don't exactly have
any other options anyway.

So yeah, that's it. Come join us in the Happy Land of GDI+ and
System.Drawing Hacking! We welcome you all!

Let's roll! ;-)

Duncan.



More information about the Mono-devel-list mailing list