[Geany-Devel] RFC: Proxy plugins
elextr at xxxxx
Thu May 8 04:15:06 UTC 2014
Sorry for the double post, but Murphys law says I found the code just
*after* posting :) More details below.
On 8 May 2014 13:03, Lex Trotman <elextr at gmail.com> wrote:
> Hi Thomas,
> A somewhat similar method that I had a (very rough) prototype for,
> used a .so wrapper for each non-native plugin (I was using python and
> used most of geanypy) providing the API wrapper for that language.
> There was a "language manager" plugin for the language which did the
> initialising for the language (in Python that was PyInitialize).
> Note that none of the communication to the plugin went through the
> language manager, so it was no longer a proxy, each plugin was a full
> strength first class plugin with all the capabilities (and
> responsibilities). The wrapper could provide as thin or as thick an
> adapter as the language needed.
> This seemed to work, and so long as the language manager didn't
> Pyfinalise the plugins kept working after it was closed. What I
> hadn't gotten around to doing was your proposed communication between
> the language manager and Geany so the plugins could be in the plugin
> manager list.
In fact I got it to appear in the Geany plugin manager by:
1. the Python language manager plugin scanned the Python plugins
directory and copied a numbered .so into the Geany plugins directory
where the Geany plugin manager would see it.
2. when the numbered .so is loaded it asks the language manager (using
its number) which python plugin it should load.
3. it then g_module_opens the Python bindings, which load and run the
Python plugin returning the information to the Geany PM.
This is pretty tricky but it makes the python plugins appear in the
geany plugin manager as if they are C ones so they have full
capabilities (and especially can have keybindings, something that
doesn't work right in Geanypy) and it doesn't need any modifications
to Geany itself, so the API is unchanged.
> Unfortunately I can't find the code ATM, and may have lost it in one
> of the disk crashes (backups??) but hopefully the information that it
> is possible will be useful.
More information about the Devel