plugins: introduce probe() for proxy plugins
commit3ccf959013edb6744ab58f6953a2b44dfb1abef3
authorThomas Martitz <kugel@rockbox.org>
Wed, 26 Aug 2015 21:58:21 +0000 (26 23:58 +0200)
committerThomas Martitz <kugel@rockbox.org>
Mon, 5 Oct 2015 20:11:12 +0000 (5 22:11 +0200)
treee1ecf53710685294be355db47f81f2035d550395
parente5bb6571c60be2169c3d66ae38c72d72709bf10e
plugins: introduce probe() for proxy plugins

When a file extension alone is ambigious as to whether a potential plugin is
really handled then the proxy should use the probe hook to find out. This can
be especially helpful when two pluxies work on the same file extension.

The proxy's probe() should return PROXY_IGNORED or PROXY_MATCHED accordingly.
A special flag value, PROXY_NOLOAD, can be or'ed into PROXY_MATCHED to say
that the file belongs to the proxy, but isn't directly loaded and should not
be handled by any other proxy or geany itself.

Example for PROXY_IGNORED:
geanypy only supports python2 at the moment. So, scripts written
for python3 aren't handled by it and should be skipped for the PM dialog.
Or perhaps they are handled by another proxy that supports python3.

Example for PROXY_NOLOAD:
A pluxy registers for the metadata file extension (.plugin) where author etc
is in. The actual implmentation is in a python script (.py). The .py file
is tied to the .plugin and should not be processed by other pluxies. Thus,
the pluxy also registers for the .py extension but returns
PROXY_MATCHED|PROXY_NOLOAD for it (if it would return only PROXY_MATCHED
the sub-plugin would show up twice in the PM dialog).
src/plugindata.h
src/plugins.c