Le 11 août 10 à 00:04, Richard Heck a écrit :
Then this gets written in the lyx file as
\begin_inset Flex Noun
...
Question: Why even bother with the "Flex:" prefix? We don't have a
default "InsetLayout Flex"
and I don't see any reason to have one. Also....
It is a namespace. If we have someday a Flex inset editor, and the use
creates a Note custom
inset, it will be perfectly file. In layout files, we'll have to use
InsetLayout Flex:Note
and everything will be fine. No overloading problem.
We can see these prefixes as namespaces. For now, it is only
aesthetics, but in time I
would like that to become syntax (like in css or X resources).
The plan would be:
* layout2layout: for all insets layouts which name is not in the
hardcoded list
(Note, Branch...), including Custom:, CharStyle:, and Element:,
remove the existing prefix
and replace it with Flex:
* lyx2lyx: do the same, but do not add Flex: :)
If we do different things in these two places, then we have to
change something in the C++ code, too.
Err, yes, I forgot that:
* change InsetFlex::name() to return "Flex:<type>", like other name()
methods (Float, Info, Note, Capton...).
In the future, I would like this name() method to move up the tree,
maybe even
at Inset::name().
In particular, we'll have to add the "Flex" back onto the layout
name when we create the InsetFlex.
Not with the change outlined above.
Basically, "Flex" is the class (like Note, Branch, Index...), and Noun
the type.
I think it is important to convey in InsetLayout where the inset
stands in the hierarchy.
So I'd just forget about "Flex:", and I don't think this would
actually take much work. I.e., I could do it.
I'd really rather keep it, for the reasons outlined above. Think in a
few years, where the underlying lyx will be
<inset class="flex" name="noun" ...>
Then, a fully hierarchical InsetLayout will make much sense.
JMarc
PS: and indeed, I'd like to forbid ':' in flex inset names.