On 25 February 2010 00:17, Nick Treleaven <nick.treleaven@btinternet.com> wrote:
On Sun, 21 Feb 2010 15:03:01 +0100
Enrico Tröger <enrico.troeger@uvena.de> wrote:

> >As I see it there area couple of ways of implementing your suggestion:
> >
> >1. a basic build system in the core and the advanced one in the
> >plugin, or
> >2. the two plugins approach
> >
> >1. has the advantage that the basic system is always available even if
> >Geany is started without plugins, but then the build-in system needs
> >to be able to be completely disabled when the plugin takes over
> >2. makes the takeover problem simpler,
> >
> >But both require that everything that the build system needs to do is
> >available through the plugin API, and thats likely to be a big API,
> >much of which no one else will want to use.  This includes interface
> >to the preferences and filetype files for saving and restoring
> >settings.
> >
> >Now as I understand it, what we are trying to achieve is:
> >
> >1. By default Geany provides a set of capabilities roughly equivalent
> >to 0.18
> >2. By default Geany provides an easy configuration capability that
> >hides complex capability
> >3. An alternative that allows "configure everything" control
> >
> >Now it seems to me that it doesn't matter how complex the internal
> >operation of the build system is, so long as a default user sees
> >functionality as at
> >1. and 2. does not expose that complexity.
> >
> >So I propose that a build-system with full capability but only a simple
> >configuration dialog be in core, and the full configure dialog be in a
> >plugin.
> >
> >This makes the plugin interface much narrower, mostly the capability
> >to set the configuration.  That interface would be the interface to
> >the "operation" object I defined in the design spec (I'll get you to
> >read it yet ;-)
>
> In the meantime, I realised my idea wasn't the best I ever had...:)
> But I do like your proposal to have it all in the core except the
> "heavy" configuration dialog which could be in a plugin.
>
> As long as it works in the end, I'm all for it.
>
> Just go to get it, I don't want to hinder new stuff any longer.

Personally I'm not sure that tying the two implementations together is
a good idea. I haven't really studied Lex's build.c implementation but
I don't want to have to expose all of it to the plugin API. This will
straightjacket any changes we want to make on the core build system.

Totally agree, thats why I am proposing to change it so that only the configuration interface be exposed (see attached proposed interface).

This interface is narrow, typesafe, and expandable but exposes little of the internal workings because the BuildOperation type is opaque.
It is also ABI safe if extra fields and functions are added and still ABI safe if enums are extended and API safe if no functions/enums are removed.

This API also makes it possible for other plugins to manipulate settings such as Franks proposed plugin that sets build commands based on contents of latex files.


One option would be for a plugin to completely replace the build system
by hiding the build menu and overriding the build keybindings.

This would make loading/storing settings messy, the filetypes, project and preferences load/store interface needs to be available to the plugin.  And what happens if the plugin isn't loaded when the filetypes etc are loaded? When the plugin is loaded how does it get to re-load these settings? Or does the plugin have to have another set of settings files mirroring the filetype projects and preferences files?  And structures mirroring the GeanyFiletype, GeanyProject etc structures or do those structures have fields for a plugin that may not be loaded?

Makes the plugin much bigger and also requires more of the build functionality to be exposed unless everything is re-implemented in the plugin in which case maintenance is a nightmare to keep them in line.  For example the build_command, build_run _cmd, build_replace_placeholder functions.

Cheers
Lex
 

Regards,
Nick
_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel