introspection (and python bindings): callbacks with GError** parameter?



Dear gobject-introspection hackers,

I am trying to use some GdkPixbuf methods from Python via PyGI and ran
into something that made me wonder.

I already wrote to the python-hackers list (pygobject devs) about this
issue yesterday:
http://mail.gnome.org/archives/python-hackers-list/2011-February/msg00001.html

Since I didn't get an response yet, I started looking into the issue a
bit myself.

In the GIR constructors and methods with a GError** parameter don't get
this parameter listed explicitly, instead the XML type get the magic
attribute 'throws="1"'.

Now, the callback "PixbufSaveFunc" didn't get one (note: this is the one
where I already played with the anootations):

    <callback name="PixbufSaveFunc" c:type="GdkPixbufSaveFunc">
      <return-value transfer-ownership="none">   
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="buf" transfer-ownership="none">
          <type name="utf8" c:type="gchar*"/>
        </parameter>
        <parameter name="count" transfer-ownership="none">
          <type name="gsize" c:type="gsize"/>
        </parameter>
        <parameter name="error"   
                   direction="out"
                   caller-allocates="0"
                   transfer-ownership="full">
          <type name="GLib.Error" c:type="GError**"/>
        </parameter>
        <parameter name="data" transfer-ownership="none" closure="3">
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
      </parameters>
    </callback>

It seems like there is no reason a callback could not also have a
"throws" attribute.  However, there is the "data" parameter coming after
the GError** and presumably the GError** should be last.

So am I wondering how this case should be dealt with at all... maybe a
small brain teaser for you guys. :)

Thanks,

	Christophe




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