Re: [anjuta-devel] Vala and the new code-assistance architecture



Hello Moritz,

                  في ث، 19-06-2012 عند 18:57 +0200 ، كتب Moritz Lüdecke:
Hi,

I tried to copy the code of the setting widget from the cpp-java plugin 
to the vala plugin, but I don't know, how I can integrate glib 
interfaces in Vala or in other words, how I can link the methods.

I pushed the code on github: 
https://github.com/ritze/anjuta-clang/blob/ada9e5698d252d5d29b4624fbcba03643651cc7a/plugins/language-support-vala/plugin.vala

The two methods, which I tried to integrate, are ipreferences_merge and 
ipreferences_unmerge. I already tried to override the two methods 
"merge" and "unmerge", but the vala compile shows the following error:

error: overriding method `ValaPlugin.merge' is incompatible with base 
method `IAnjuta.Preferences.merge': incompatible type of parameter 1.

I think the first parameter is correct.

It looks like the code producing this error isn't the code you've posted
above. Anyway, the interface is defined as:

public interface Preferences : GLib.Object {
        public static GLib.Quark error_quark ();
        public abstract void merge (Anjuta.Preferences prefs) throws GLib.Error;
        public abstract void unmerge (Anjuta.Preferences prefs) throws GLib.Error;
}

so the methods should be implemented as
public void merge (Anjuta.Preferences prefs) throws GLib.Error {
        //...
}
public void unmerge (Anjuta.Preferences prefs) throws GLib.Error {
        //...
}

Is that what you're doing?




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