[Vala] Gtk.SourceLanguageManager bindings



I had some issues with Gtk.SourceLanguageManager; the get_language_ids
and get_search_path functions are meant to return pointers to arrays
(string []), but instead just return plain strings.  I've modified
the .vapi file to have them return unowned string [] types, plus I added
in a method that was not bound for some reason, the "guess_language"
method, which I have tested in my code; it works fine.

Modifying the file isn't tough; it's just one class, and it looks like
this with my modifications:

        [CCode (cheader_filename = "gtksourceview/gtksourcelanguagemanager.h")]
        public class SourceLanguageManager : GLib.Object {

                public static unowned Gtk.SourceLanguageManager get_default ();
                public unowned Gtk.SourceLanguage get_language (string id);
                public unowned Gtk.SourceLanguage guess_language (string? filename,
string? content);
                [CCode (array_length=false, array_null_terminated=true)]
                public unowned string [] get_language_ids ();
                [CCode (array_length=false, array_null_terminated=true)]
                public unowned string [] get_search_path ();
                [CCode (has_construct_function = false)]
                public SourceLanguageManager ();
                public void set_search_path (string dirs);
                public string[] language_ids { get; }
                public string[] search_path { get; set; }
        }

-Andrew




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