Native GTK2 D Bindings

Kagamin spam at here.lot
Sat Jan 28 08:28:00 PST 2012


On Tuesday, 24 January 2012 at 16:09:21 UTC, Artur Skawina wrote:
> So instead of:
>
>> gdk_rectangle_union(&dirtyRect, &event.area, &dirtyRect);
>
> you can write:
>
>> dirtyRect.union_(&event.area, &dirtyRect);

For some reason
gdk_rectangle_union(&dirtyRect, &event.area, &dirtyRect);
looks better.

> and all of these will result in identical code being emitted.

what if
struct Rectangle
{
  GdkRectangle r;
  alias r this;
... methods ...
}

Will a different code be emitted?
Will alias this work with C api?

> And, yes, this is probably suitable for Deimos, iff part #3 is.
> (I see no advantage in splitting out the trivial "methods")

C bindings are a value on their own, this is probably why deimos 
doesn't like #3: your methods will be a burden to other 
users(libraries) of the bindings.


More information about the Digitalmars-d-announce mailing list