[Vala] Wanting to write a nautilus extension
- From: Nathan Samson <nathansamson gmail com>
- To: vala-list gnome org
- Subject: [Vala] Wanting to write a nautilus extension
- Date: Mon, 7 Mar 2011 14:42:41 +0100
I'm trying to write a nautilus extension in Vala. Herefore I have to write
bindings for the libnautilus-extension.
I wrote the bindigns with vala-gen-introspect and vapigen.
First problem: vapigen crashes because a previous definition of FileInfo
(once as interface and once as struct)
The complete error is:
libnautilus-extension.gi:0.0-0.0: error: `Nautilus' already contains a
definition for `FileInfo'
libnautilus-extension.gi:0.0-0.0: note: previous definition of `FileInfo'
./construct.sh: line 2: 5135 Segmentation fault vapigen --pkg glib-2.0
--pkg gio-2.0 --pkg gtk+-2.0 --library libnautilus-extension
I work around this problem bij hiding NautilusFileInfo in the .metadata
file. This is not optimal because I will need it probably very soon. I guess
this is a bug somewhere.
Another problem I'm having is that I need to implement a function with a
signature of "void nautilus_list_types(const GType** type, int* ntypes)
When I create a function (in namespace Nautilus) with the name list_type and
parameter out GLib.Type, the C compiler complains about incompatible types
(the const is missing in my file, but it is defined in the nautilus header
My workaround was to change the sysyem wide header file and remove the
const. Of course this is not ideal. ANyone knowing a better workaround?
Last problem (and the one I'm stuck with) is that according to C examples,
and a tutorial (http://www.linux.com/archive/feature/114134?page=3) I have
g_type_module_add_interface and g_type_module_register_type in
Nautilus.module_intialize. But these functions are hidden in vala. Anyone an
idea how I can fix this?
To understand recursion, you must first understand recursion.
] [Thread Prev