[Geany-Devel] [FT-plugins] Proposed Design

Colomban Wendling lists.ban at xxxxx
Tue Aug 30 13:29:11 UTC 2016

Le 29/08/2016 à 03:09, Matthew Brush a écrit :
> On 2016-08-28 05:47 PM, Matthew Brush wrote:
>> [...]
>> To give an idea, the registration function called by plugins might look
>> something like this:
>>     gboolean ftplugin_register_provider(GeanyPlugin*,
>>         GeanyFiletypeID, GeanyFiletypeFeature, GCallback, gpointer);
>> [...]
> I forgot to mention, it may turn out that in order to provide a feature,
> there may be a need for multiple callbacks (ex. activate, deactivate,
> init_styles, prepare_list, whatever). If this ends up being the case, we
> would need to either pass a table of callbacks here or perhaps a GObject
> implementing a particular interface or whatever.

Then probably better make the provide a structure like

GeanyAutoCompleteProvider {
	GeanyFiletypeID filetype;
	GCallback feature1;

In theory I have nothing against GInterface, but I'm not quite sure it's
a good idea to start riddling Geany with GObject API where we already
have like 2 non-GObject-ish API styles (plugin registration, Proxy
registration, signals…)

Not saying GInterface is a presona non-grata, but that IMO it would have
to prove very useful over the other solutions to be used.  Especially as
people are likely to implement these filetype features in C or C++ more
than Python, JavaScript or Ruby, so it should be comfortable in C and
C++, and you know you don't like GObject boilerplate :)

More information about the Devel mailing list