[Github-comments] [geany] Proxy plugins (#629)

Colomban Wendling notifications at xxxxx
Thu Sep 24 22:04:33 UTC 2015


> Wait a minute, for the new_hooks you convinced me that *this* method flawed (due to the points you mentioned) and now you're trying to sell it to me? I'm confused.

It's a little more subtle and a little less absurd than that :)

IIRC what you initially did in new_hooks was to fill in a struct to copy it back to the GeanyPlugin structure.  As I agree the funcs are part of the plugin itself, and as it has the above-mentioned flaws, I found it to make a lot more sense to fill the existing structure right away.

Here the thing I find odd is that I feel like the plugin itself and the proxy are two separate things, so filling the first to register the second seem odd to me.  They require calling 2 different register functions, but on the same structure.  That's the only reason why I somewhat try to find an alternative API I find more straightforward (for me).
Do anybody else feel that way?  @elextr @codebrainz ?

Anyway, having
```C
Proxy *proxy = proxy_new();
proxy->probe = my_probe;
...
plugin_registre_proxy(plugin, proxy);
```
would basically make as much sense than the plain struct initializer solution, but requires adding more API (the _new()).  Not saying it's a great API either just now though :)

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/629#issuecomment-143062346
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20150924/9e1448a7/attachment.html>


More information about the Github-comments mailing list