Re: GInterfaces and API Stability



Am Mittwoch, den 14.11.2007, 17:40 +0100 schrieb Murray Cumming:
> On Wed, 2007-11-07 at 14:58 -0700, Mike Kestner wrote:
> [snip]
> > While it may not break C ABI/API to add a method to an existing
> > GInterface, adding a method to an interface is a clear break in C#.
> > You
> > must implement all members of a C# interface, so code which previously
> > compiled will break when a method is added to an interface.
> [snip]
> 
> Can't you just choose not to wrap that vfunc in your C# binding?
> 
> I think this is similar to a problem we have in gtkmm. When a GTK+
> widget implements an extra GInterface, we can't just add a base class to
> our existing C++ class, because that would break ABI in C++. So we just
> don't wrap it, and tell people to use the C API when they need to use
> that part of the API. It doesn't happen much, luckily.

Wouldn't it possible to implement the GInterface as C++ class and add an
operator like this to the GObject wrapper class:

  public:
    GLib::RefPtr<GFooInterface> operator () { 
	return GLib::wrap_interface (gobj ());
    }

?
-- 
Mathias Hasselmann <mathias hasselmann gmx de>
http://taschenorakel.de/

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]