Skip to content

Instantly share code, notes, and snippets.

@boblehest
Last active January 11, 2021 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boblehest/7126895d40cfa765db4813ca0b5a8f6b to your computer and use it in GitHub Desktop.
Save boblehest/7126895d40cfa765db4813ca0b5a8f6b to your computer and use it in GitHub Desktop.

After compiling the file, using

valac foo.vala --library=foo --gir=foo-1.0.gir -C

I expect the method Bar::f to have an instance-parameter (self/this) listed in the GIR output, but it does not. Why? I extracted the relevant bit here:

<method name="f" c:identifier="foo_bar_f">
	<return-value transfer-ownership="none" allow-none="1">
		<type name="gpointer" c:type="FooBar*"/>
	</return-value>
</method>
<?xml version="1.0"?>
<!-- foo-1.0.gir generated by valac 0.48.9, do not modify. -->
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="GObject" version="2.0"/>
<package name="foo"/>
<c:include name="foo.h"/>
<namespace name="foo" version="1.0" c:prefix="Foo" c:identifier-prefixes="Foo" c:symbol-prefix="foo">
<class name="Bar" c:type="FooBar" c:symbol-prefix="bar" glib:type-name="FooBar" glib:get-type="foo_bar_get_type" glib:type-struct="BarClass" glib:fundamental="1" glib:ref-func="foo_bar_ref" glib:unref-func="foo_bar_unref" glib:set-value-func="foo_value_set_bar" glib:get-value-func="foo_value_get_bar">
<field name="parent_instance" readable="0" private="1">
<type name="GObject.TypeInstance" c:type="GTypeInstance"/>
</field>
<field name="ref_count">
<type name="gint" c:type="volatile int"/>
</field>
<field name="priv" readable="0" private="1">
<type name="BarPrivate" c:type="FooBarPrivate*"/>
</field>
<method name="f" c:identifier="foo_bar_f">
<return-value transfer-ownership="none" allow-none="1">
<type name="gpointer" c:type="FooBar*"/>
</return-value>
</method>
<constructor name="new" c:identifier="foo_bar_new">
<return-value transfer-ownership="full">
<type name="Foo.Bar" c:type="FooBar*"/>
</return-value>
</constructor>
</class>
<record name="BarClass" c:type="FooBarClass" glib:is-gtype-struct-for="Bar">
<field name="parent_class" readable="0" private="1">
<type name="GObject.TypeClass" c:type="GTypeClass"/>
</field>
</record>
<record name="BarPrivate" c:type="FooBarPrivate" disguised="1"/>
</namespace>
</repository>
namespace Foo {
public class Bar {
public Bar* f() {
return this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment