I played a bit with generating bindings for stuffkeeper, this went suprisingly easy. The output needed manual tweaking, but after spamming a bit on #vala I got that sorted out aswell (sorry for that, it was late).
So this now works: (yes it does nothing usefull):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | using GLib; using Stuffkeeper; public class Test : Stuffkeeper.Plugin { public override PluginType get_plugin_type() { return PluginType.MENU; } public override weak string get_name() { return "Vala Test Plugin"; } public override void run_menu(Stuffkeeper.DataBackend skdb) { weak List list = skdb.get_items(); foreach (Stuffkeeper.DataItem item in list){ stdout.printf("%s\n", item.get_title()); } } } [ModuleInit] public GLib.Type register_plugin() { return typeof(Test); } |
2 Comments
Hmm, is it also/will it also be possible to write Vala plugins for gmpc? I’m thinking about experimenting with Vala sometime, and writing a gmpc plugin would be a nice way to do that I suppose
Yes it is possible, offcourse. It is just a bit more work, as gmpc plugin system isn’t based on a G:Object. Something I want to change after the next release.