g-ir-scanner not recognising non-virtual functions
- From: Tony Houghton <h realh co uk>
- To: gtk-devel-list gnome org
- Subject: g-ir-scanner not recognising non-virtual functions
- Date: Mon, 26 Sep 2011 13:59:10 +0100
I'm developing a simple wrapper library, with the objects defined using
gob2 and I want to export gi bindings for it. At first I didn't bother
making the object methods virtual but they didn't get exported into the
.gir file. When I made them virtual they did get exported. However, I
would also like to export *_new() constructor functions, which aren't
object methods for obvious reasons. And I'm likely to want some other
utility functions which won't be associated with any object.
I've had a quick look at pango (because I already had its source lying
around) and AFAICT that is using non-virtual functions in gir. But it
doesn't seem to be using any extra annotations or g-ir-scanner flags
(difficult to tell, because it uses autotools, and I'm not).
For example, I would like to export this function:
class Gsqlite:Database
from G:Object
{
// ...
/**
* new:
*
* @filename: filename of the database or ":memory:".
* @error: (out) (allow-none) (default NULL):
*
* Returns: a new database object or %NULL
*
* Use g_object_unref() to close. All statements must be finalized
* separately.
*/
public Gsqlite:Database *
new(const gchar *filename, GError **error)
{
GsqliteDatabase *self = GET_NEW;
return self_check_open_for_new(self, self_open(self, filename, error));
}
// ...
}
and I'm calling g-ir-scanner like this:
${G_IR_SCANNER} --namespace=Gsqlite --nsversion=0.0 \
--include=GObject-2.0 --pkg=gobject-2.0 --pkg=sqlite3 \
--libtool=${LIBTOOL} --library=gsqlite \
-L${BUILD_DIR} -I${BUILD_DIR} -I${SRC_DIR} \
${SRC} -o ${TGT}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]