Richard Heck <[EMAIL PROTECTED]> writes:

> 1. Derive InsetCollapsableCustom as a subclass of InsetCollapsable.
> This will do all the general "customized inset" stuff shared between
> InsetCharStyle and the new thing: e.g, setDefined() and the like would
> appear here. Then InsetCharStyle could inherit from this, too. Another
> option would be to make InsetCustom a mixin, so that some of this
> could be used by a hypothetical InsetCommandCustom.

I think all the different different inset states we have now (inlined,
char-style like, collapsed, open...) should be merged into
InsetCollapsable. 

The stuff to make things customisable should go either in an
InsetCustom that depends on InsetCollapsable. In any case, all the
insets like Footnote should derive from this.

All these insets should be make it possible to change both the
appearance and the LaTeX output. Martin only did the appearance up to
now, but this is work in progress.

> 2. Other modifications:
> *TextClass will need a list of customized collapsable insets, which
> now would be defined not using CharStyle but in some other way, say,
> via: InsetCollapsable. These will be read in read(), of course.

This is already Martin's InsetLayout thing. It is the place that
defines the layouts. InsetFoot is one of these layouts (it would not
be available if not declared), which just happens to have also some
stuff hardcoded in LyX.

> *MenuBackend will have a routine to add the defined Collapsible inset
> to the menu, and their location will be set in stdmenus.inc, as usual,
> we'll need a "CollapsableInsets" menu entry, with corresponding
> changes in read(). 
>We will also need something similar to
> expandCharStyleInsert(), and will need a similar bit in expand(). Need
> to add something to MenuItem, in MenuBackend.h, as well.

If charstyles have names like charstyle:noun, then a "Insets
charstyle" menu entry could give a list of all insets.

> *LaTeXFeatures::getTClassPreamble(): needs a corresponding bit for
> these things.
> *Need a new LFUN instead of LFUN_CHARSTYLE_INSERT, so this involves
> changes to factory.cpp, lfuns.h, LyXAction.cpp, Text3.cpp,
> insets/InsetERT.cpp, and insets/InsetTabular.cpp: Basically, we can
> mirror a lot of what happens with CharStyles in these files.
>
> Comments on the plan?

It is good.

JMarc

Reply via email to