[Vala] Wanting to write a nautilus extension



Hi all,

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'
was here
./construct.sh: line 2:  5135 Segmentation fault      vapigen --pkg glib-2.0
--pkg gio-2.0 --pkg gtk+-2.0 --library libnautilus-extension
libnautilus-extension.gi

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
file).
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
to call
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?

Greetings,
Nathan


-- 
To understand recursion, you must first understand recursion.


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