Re: [Vala] plugin development in Vala



On Die, 2007-03-06 at 08:06 +0100, Mathias Hasselmann wrote:
As I am also interested in porting bulldozer to Vala I've looked at the
problem. Beginning was quite easy:

using GLib;

public class NautilusModule
{
        public static void initialize(TypeModule module)
        {
                module.register_type(typeof(NautilusModule));
        }

        public static void shutdown()
        {
        }

        [NoArrayLength ()]
        public static void list_types(out Type[] types, out int ntypes)
        {
        }
}

Expect that Vala doesn't properly convert "out int" into "int *". Well,

"ref int" should be working as in C#, valac just doesn't report an error
yet when using out in front of value types.

and to comply with C#, Vala should accept [Attribute] in addition to

Yes, we'll probably add support for that, although we're not quite sure
whether we keep the attribute syntax as it is now or move to something
similar to the Java annotation syntax; it wouldn't matter functionally,
though.

[Attribute ()]. Vala also needs some attribute to express that ntypes
contains the array length. There also are various places in the vapi dir
which would benefit from that addition.

That's the plan. It already works if the array length is to the left of
the array but it still lacks the configurability to use other positions
of the array length.

Real trouble started when telling glib-2.0.vala about GTypeModule:
[...]

We should support this in Vala with an attribute on the type to get this
working properly I'll look into it.

Jürg




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