I think I have a rough idea as to how can we implement the layout editor,
in Lyx
I have made a Qt prototype http://postimg.org/image/j9g22xphx/ described as
below!
**********GUI***********
Available Additions : A QComboBox used to choose from a list of available
options "ClassOptions" , "Paragraph styles",
"Floats", "Flex insets and InsetLayout", "Counters", "Font description",
and their possible
suboptions like a "Paragraph style" can have "Font Description" as its
subtype

Layout elements: A QListWidget containing the new Class elements
"ClassOptions" , "Paragraph styles",
"Floats", "Flex insets and InsetLayout", "Counters", "Font description".
The user will select any one of them
and he will be shown the available options in the element specifics section.
for e.g if the user chooses "Paragraph styles" then he would be shown with
options like "Align", "BottomSep",
"Copy Style" etc. as much as possible without any coding stuff, this would
be shown in layout specifics
section.

Layout specifics: It will contain yet another QListWidget which would
display the suboptions which are possible to
add into it, and it will have Values section as each option will have to
take values like number, color, option
etc. some type of values might be common while others might be unique to
the option, which would be shown to the
user appropriately.

Layout Preview: It is a QGraphicsWidget which will try to display in as
much capacity as possible the combined look showing the usage of every
layout element created, added or edited. For eg if I created two paragraph
styles, style1 and style2 then it
will show two sentences instantiating the styles.

Layout file: section would be meant for advanced users to directly modify
the code, or add some Latex stuff to their
liking.

******BACKEND******
The backend structure which would be supporting the GUI would have the
simple task of parsing the .layout
file based on the layout elements created by the user listed in the Layout
Elements List.
Implementation of this can be done in the following way:
->We create a class LayoutElements and then introduce methods in it which
would parse it into lines of code
readable to a .layout file.

******ENSURING ROBUSTNESS*****
To ensure robustness one has to make visibility of preview as dynamic as
possible.
Also the methods which parses the LayoutElements objects into lines of
readable .layout code
should minimize errors caused due to user's carelessness.

Mentors kindly review this for me and point out loopholes and suggestions
if any.

Reply via email to