[Geany-devel] geany-plugins depends on GIO - plugin API

Nick Treleaven nick.treleaven at xxxxx
Tue Nov 23 12:30:38 UTC 2010


On Tue, 23 Nov 2010 09:20:35 +1100
Lex Trotman <elextr at gmail.com> wrote:

> >> , but I don't really think we should add accessors for
> >> >> all fields.
> >>
> >> @Nick,
> >>
> >> Well you have in the past commented negatively about making structures
> >> visible.  As you sagely said either you constrain your implementation
> >> or yuo have to spend the effort "faking" the structure for plugin
> >> purposes.
> >
> > It depends on what fields we're talking about. For a getter function
> > for a pref, there's not much you can do if the behaviour of the pref
> > changes or the pref is removed, the function will be no better than
> > the field.
> 
> Yes semantic changes breaks the item, but ATM all you can do is break
> the whole ABI.
> 
> If a field is removed from a structure the getter function may still
> be able to compute it or get it from the new location instead of
> another structure needing to be exposed.

True, but we have a lot of fields in the API, it seems a bit ugly to
have tons of getter functions.

> > Getting groups of prefs is different. One solution for overridden prefs
> > is editor_get_indent_prefs():
> > http://www.geany.org/manual/reference/editor_8h.html#db89e1ea679531fb35ba13efa2c93eda
> >
> > Perhaps this would be a good approach for other pref groups.
> 
> Yes, as time and inclination permits.

I have been meaning to add editor_get_prefs() as a future-proofing
function. It would be much tidier than core functions like
editor_get_long_line_*() which are specialized and just check whether
to use project or global prefs.

Nick



More information about the Devel mailing list