Thot Editor is a large piece of software. If you want to change it or extend it in some way, you may experiment some difficulty in finding out the right part to be modified in the code. The purpose of this note is to help you understand the Thot Editor architecture and find your way in the source code.
2 Changing and extending Thot Editor
2.1 Changing menu bars and pull-down menus
2.3 Changing default document presentation
2.5 Adding new HTML tags and attributes
2.6 Modifying existing commands
2.7 Creating new editing commands
2.8 Adding new structure transformations
Thot Editor is an application based on Thot. Thot is a generic tool kit intended to build document based applications, with a structured approach to the document model. Basically, Thot provides a set of document manipulations functions with an API and allows applications to include additional functions through a callback mechanism. It can also includes a simple declarative language to generate the user interface of an application.
Different document representations are maintained or generated by Thot Editor:
.S
in directory
schemas
), written in the S language (see the language manual).
Names of element types and attributes in structure schemas are not those that
the user actually sees on the screen. Correspondence between internal and
external names is given by files suffixed by en and
fr
in directory amaya
.
s
suffixed by .P
in directory schemas
), written in the P language (see the language manual).
The presentation schema specifies all possible views of documents and the aspect of these documents in each view. It also specify how documents should be formatted for printing.
Thot Editor uses a single source file (.P
) to specify different
presentation schemas, using conditional compilation (see variables
PAGE
, BLACK_WHITE
, US_PAPER
).
.T
in directory schemas
), written
in the T language (see the language manual).
The main software components involved in Thot Editor are the following:
This bar and all its menus, including cascading menus, are specified in a Thot
application schema (file EDITOR.A
in directory
amaya
) written in the A language (see the A language
manual).
This button bar is created by Thot Editor at initialization time (see function
AttacherIcones
in module drawlib/boutons.c
).
Some of these dialogue boxes are standard Thot library dialogue boxes, other are created by the Thot Editor application. Both Thot library and Thot Editor use the Thot dialogue module.
Ttc
.
EDITOR.A
in directory thot
) and are implemented in
the C modules of directory thot
.
AttacherIcones
in module drawlib/boutons.c
)
and are implemented in the C modules of directory drawlib
.
EDITOR.A
(directory thot
) and
implemented in the C modules of directory thot
. They implement
some specific treatments.
A number of modifications to Thot Editor can be made without modifying the C code. As explained above, the behavior of Thot Editor is defined by a number of schemas and other files that can be modified easily, as they are written in very simple declarative languages. Prior to making any change to the source code, it's worth considering modifications to these files.
You may want to change the user interface. The simplest change you can make is modifying the menu bars and the pull-down menus.
There is a menu bar on top of each window handled by Thot Editor. Notice that the contents of these menu bars vary according to the view displayed in the window.
All menu bars and the corresponding pull-down menus are defined in file
EDITOR.A
(directory thot
). Update that file for
defining your own menu bars (it is written in the A language, which is
documented in The Thot Application Generation Language). Then, you
just have to make thot
.
If you want the new (or existing) menus and their items to be available in
different languages, don't forget to update the xx-thotdialogue
file (in directory config
), where xx
is the language
name (for instance, en
for English or fr
for
French).
You can change the button bar of the formatted view in many ways. You can
For all these changes, you have to edit the function
ApresOuvreVue
in module thot/EDITORactions.c
and to
make thot
.
To create new commands, you have to define their user interface (add a new menu to a menu bar, a new item to an existing menu and/or a new button to the button bar) and to write the code of the corresponding function.
Users can configure Thot Editor in various ways, just by editing some configuration files. This is described in the document Configuring Thot Editor.
V. Quint
$Date: 1997/02/07 00:04:51 $