It just occurred to me while tinkering with this, if the `pdata` argument had 
come first, then one could use member functions directly in the 
`GeanyPluginFuncs` setup without the need for separate C wrapper boilerplate. 
It would probably require typedefs for the function pointer types to facilitate 
type casts. A basic wrapper plugin over a GObject could've looked like this:

```vala
// some gobject in vala, to save typing
namespace Foo {
  public class Plugin {
    bool init(Geany.Plugin p) { return true; }
    void cleanup(Geany.Plugin p) {}
  }
}
```

```c
// the actual plugin implementation
G_MODULE_EXPORT void
geany_load_module (GeanyPlugin *p)
{
  p->info->name = "Foo";
  ...
  p->funcs->init = (GeanyInitFunc) foo_plugin_init;
  p->funcs->cleanup = (GeanyCleanupFunc) foo_plugin_cleanup;
  ...
  GEANY_PLUGIN_REGISTER_FULL (p, 42, foo_plugin_new, g_object_unref);
}
```

I don't know if it can be changed now or some alternative funcs with swapped 
arguments added, I just thought I'd mention it as I just coded 4 hook functions 
to do nothing but reverse the arguments to call another C function.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/commit/437837d3a54367393c41d6c1e1f4d1af4481627e#commitcomment-19107275

Reply via email to