[Gtk-sharp-list] Pixbuf API observations.

Mike Kestner mkestner@speakeasy.net
19 Feb 2003 21:09:13 -0600


On Tue, 2003-02-18 at 23:46, Miguel de Icaza wrote:

> > Well, technically any ctor could return NULL, so we should probably be
> > guarding all PInvoked ctors with a similar check.  The only question is
> > what exception to throw. Maybe a GLibSharp.ObjectConstructionException
> > or something like that. 10 minute hack to generator/Ctor.cs.
> 
> I think that we should only do this for constructors that have a high
> degree of probability in failing.   For example, a couple of the Pixbuf
> ones might fail due to memory requirements.

Well, we could implement this as a metadata rule identifying an
exception type to throw on null.  The cost of an additional comparison
for each pinvoked ctor doesn't seem high though, and would be easier to
implement.

> > >
> > > 	* Pixbuf.Copy should probably be Pixbuf.Clone, and we could have
> > > 	  Pixbuf implement the IClonable interface.
> > 
> > I'd leave Copy alone and have Clone call it.
> 
> I implemented and documented, but how do I make the Pixbuf class list
> "ICloneable" as an interface it implements?

The xml for specifying this is:
      <implements>
        <interface cname="GtkFoo"/>
      </implements>

We use it to insert attributes, but I don't know if the metadata tool
can handle insertion of an element yet. Rachel?  We also will need to
enhance the generator to handle interfaces not defined in the xml, since
this is the first interface external to Gtk.

-- 
Mike Kestner <mkestner@speakeasy.net>