Re: [Vala] Inheriting from GLib.Action




On Feb 27, 2014, at 9:48 AM, Luca Bruno <lethalman88 gmail com> wrote:

You should define only the property, not the get_enabled() method. If get_enabled() is part of the 
bindings, that has to be removed from the interface as it's a bindings bug.

I've edited the gio-2.0.vapi file and got classes implementing the GLib.Action interface working. Here is the 
vapi segment that I think is correct:

        public interface Action : GLib.Object {
                public abstract void activate (GLib.Variant? parameter);
                public abstract void change_state (GLib.Variant value);
                public abstract GLib.Variant? get_state_hint ();
                public static bool name_is_valid (string action_name);
                public static bool parse_detailed_name (string detailed_name, out string action_name, out 
GLib.Variant target_value) throws GLib.Error;
                public static string print_detailed_name (string action_name, GLib.Variant parameter);
                public abstract bool enabled { get; }
                public abstract string name { get; }
                public abstract GLib.VariantType? parameter_type { get; }
                public abstract GLib.Variant? state { owned get; }
                public abstract GLib.VariantType? state_type { get; }
        }

However, I haven't been able to edit the Gio-2.0.metadata in a way to generate the segment above. I'm down to 
trial-and-error. Vapigen usually gives me compile warnings or errors. When it is successful, I get 
[NoAccessorMethod] which results in a SIGSEGV in the application because the interface function table isn't 
populated. Any help getting me to the next step is appreciated.

Cheers,
Ed


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