17 Customization
|
|
|
|
|
Online Documentation Home Page
Customization
This chapter describes how the look and feel of Ada-ASSURED can be
customized. The material is presented in:
Ada-ASSURED Resources
Each parameterized aspect of Ada-ASSURED can be associated with an
Ada-ASSURED resource. A site, project, or individual can
customize the behavior of Ada-ASSURED by defining resource values.
These values fall into four classes: Boolean, integer, string, and
enumerated. Here is an example of a resource of each class, together
with a typical value.
| Class | Resource | Value |
| Boolean | attributionOff | True |
| Integer | absoluteRightMargin | 80 |
| String | autoSaveNoFilePrefix | # |
| Enumerated | bellType | audible |
Standard resource initialization files are distributed with Ada-ASSURED.
Without the initializations provided by these files, Ada-ASSURED will not
behave correctly. The files may be modified to suit individual
tastes, but should not be ignored wholesale.
A default value
for each resource is compiled into Ada-ASSURED. This is the value the
resource will take if it has not been set in any other way. Default
values should not be confused with the values established in standard
resource initialization files distributed with an application. Rather,
the default is the value assumed when no such initializations are
present.
The treatment of resources differs greatly from
X Windows to
Microsoft® Windows®.
After you read the description of resources below, you should read the
section relevant to your windowing system, and then read about the
common treatment of Styles.
Here is a complete list of the Ada-ASSURED resources.
- absoluteRightMargin
-
(Integer)
An integer specifying the initial value of the editor
parameter absolute right margin.
This defines the right margin for the prettyprinter.
Lines may extend beyond this width, but only if no appropriate place
to break the line is available.
- attributionOff
-
A Boolean specifying whether the editor should initially be configured
with attribution-mode turned off. When set to True,
attribution-mode is off; when set to False, attribution-mode is
on.
- autoSaveEnabled
-
A Boolean specifying the initial value of the auto save enabled
editor parameter. This defines whether
Ada-ASSURED should periodically create auto-save files for buffers that
have associated files.
- autoSaveInterval
-
An integer specifying the initial value of the auto save interval
editor parameter. This specifies the
interval between auto-saves, in terms of the number of editor
commands.
- autoSaveNoFilePrefix
-
A string specifying the prefix used to create the auto-save
file name for buffers that do not have an associated file. This
prefix is prepended to the name of the buffer.
- autoSavePrefix
-
A string specifying the prefix used to create the auto-save file name
for buffers that have an associated file. This prefix is prepended to
the name of the file associated with the buffer.
- autoSaveSuffix
-
A string specifying the suffix used to create the auto-save file name.
For buffers that have an associated file, this suffix is appended to
the file name. For buffers that do not have associated files, this
suffix is appended to the buffer name.
- autoWindowPlacing
-
A Boolean specifying the initial value of the editor parameter
window placement. It specifies whether windows created during an
editor session should be automatically placed on the screen. Note
that some window managers will not allow automatic placement of
windows.
- backupFilesEnabled
-
A Boolean specifying the initial value of the editor parameter
backup files enabled.
It defines whether a backup file is created at the time of the first
save for a buffer that has an associated file.
- backupSuffix
-
A string specifying the suffix used to create the backup file name.
This suffix is appended to the file name associated with the file.
- bellType
-
(Enumerated)
The value audible specifies that an audible bell should ring
on entry of an illegal command and various other errors. The value
visual specifies that the screen should blink visually on
errors.
- bottomMargin
-
A real number specifying the initial value of the print parameter
bottom margin. This gives the width (in
inches) from the bottom of the paper to the bottom of the text.
- caseSensitiveSearch
-
This Boolean resource specifies the initial value of the editor parameter
Case Sensitive Search. This parameter controls whether search
and structural-search are sensitive to the case of
characters in search strings.
- columnOneComments
-
If the value of this Boolean is True, then all comments that appear in
column one
of the input will remain in column one. Furthermore, these comments
will not be wrapped like other comments.
- commentOutString
-
A character that will be used with ``--''
to introduce a commented-out section of code, such
as is created by the comment-out transform.
The default is `C', so that the usual commented-out-code
marker is ``--C''.
- defaultFileFormat
-
A value that indicates the default selection
for the file-format toggle in any of the save command
dialogs. The possible values are textFormat,
structuredFormat, and attributedFormat.
- defaultFileView
-
A value that indicates the default view in which to save files.
This initializes the view toggle in the save-as dialog box.
The possible values are BASEVIEW and MESSAGES.
- destinationFilename
-
A string that specifies the initial value of the
destination file print parameter.
This indicates the name of the file to which output should be saved if it is not to be
sent to the printer (i.e., if print parameter send to printer
is False).
- dollarIdentifiers
-
A Boolean that specifies whether dollar-prefixed identifiers are allowed.
- freeformTextBegin
-
The character c such that --c marks the beginning of
a freeform text region. Text between freeform text begin and end
markers is not formatted.
- freeformTextEnd
-
The character c such that --c marks the end of
a freeform text region. Text between freeform text begin and end
markers is not formatted.
- footerString
-
A string that specifies the initial value of the footer string
print parameter. This determines what appears
in the footer of each printed page.
- fontMappings
-
A string specifying the correspondence between font names known to the
editor (e.g. cour, times) and font names known to PostScript (e.g.
Courier, Times-Roman). These mappings are necessary in order for fonts
used in printing to match fonts used in the editor. In a single font
mapping, the name known to
the editor is followed by four names known to PostScript, all separated by
one or more spaces. The four names correspond to (in order): the font
in normal weight and slant; the font in bold weight and normal slant; the
font in normal weight and italic slant; the font in bold weight
and italic slant. Font mappings are separated from each other by
semicolons (;).
The default setting for this resource is as follows:
cour Courier Courier-Bold Courier-Oblique Courier-BoldOblique;\
times Times-Roman Times-Bold Times-Italic Times-BoldItalic;\
helv Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique;\
symbol Symbol Symbol-Bold Symbol-Italic Symbol-BoldItalic
- fontMetricLocations
-
A string specifying the initial value of the print parameter
font metric locations. This gives
a list of places to search for font metric files when printing. It must
be a colon-separated list of directories and/or files that contain font
metric (i.e., character width) information.
- foreground
-
The color to use as the default foreground color for all members of
the widget hierarchy.
- formatIsTwoColumn
-
A Boolean specifying the initial value of the print parameter
format is two column. This indicates
whether printing is to be in two column format. When True, printing
is in two column format; when False, printing is in one column format.
- hasCommandPane
-
A Boolean that specifies whether browsers should have a command pane.
- hasMenuPane
-
A Boolean that specifies whether browsers should have a menu pane.
- hasObjectPane
-
A Boolean that specifies whether browsers should have an object pane.
- hasStatusPane
-
A Boolean that specifies whether browsers should have an status pane.
- hasToolPane
-
A Boolean that specifies whether browsers should have a tool pane.
- headerString
-
A string that specifies the initial value of the header string
print parameter. This determines what appears
in the header of each printed page.
- helpOnCommandError
-
A Boolean specifying the initial value of the editor
parameter list commands. It specifies whether the entry of an
invalid or ambiguous command brings up a window displaying a list of
possible intended commands.
- indentingSpaces
-
An integer specifying the initial value of the editor parameter
indentation.
It defines the width of each indentation unit in the prettyprinter.
The unit of width is the width of a space in the largest font
specified in the style definition file.
- leftMargin
-
A real number specifying the initial value of the print parameter
left margin. This gives the width (in
inches) from the left edge of the paper to the left edge of the text.
- lineNumberInterval
-
An integer that specifies the initial value of the line number
interval print parameter. This
dictates how often line numbers are printed.
- lineNumberPosition
-
Specifies the initial value of the print parameter
line number position. The possible
values are OnLeft, OnRight, and None.
- maintainXlines
-
A Boolean specifying the initial value of the editor parameter
Maintain Xlines.
- nameMatchFormat
-
A string that specifies the appearance of the items that appear
in the name browser
invoked by find-name. See Section Name-based Browsing for
full details.
- newBufferCategories
-
A list of strings, separated by newlines, that are displayed
in a List widget in the dialog box of the new
command.
This list will assist users of the new
command in selecting the syntactic category of the new buffer.
The default list for Ada-ASSURED is compilation and textfile.
- newWindowForView
-
A Boolean that specifies the initial value of the editor parameter
new window for view.
It specifies the default radio-button setting for ``Create New
Window: '' in the change-view dialog. When set to True, the default value of the button is Yes,
which means that a new window will be created as the result of
a change-view command. If False, then the default value is No
and the view is displayed in the current window,
replacing the previous contents.
- newWindowOnOpen
-
A value that specifies the initial setting of the editor parameter
new window on open.
It defines the default radio-button setting for ``New window: '' in
the open dialog and the switch-to-buffer dialog. The
three possible values are:
- newWindowThe default value of the button is Yes and
the buffer will be displayed in a new window.
- sameWindowThe default value of the button is No and
the buffer will be displayed in the current window.
- replaceAllThe default value of the button is
Replace All; the buffer will be displayed in the current window, and
also in all other windows that were previously viewing that buffer.
- openCategories
-
A list of strings, separated by newlines, that are displayed in
a List widget in the dialog box of the open
command. This list will assist users of the
open command in selecting the syntactic category according to
which parsing of the text file should be done.
The default list is compilation and textfile.
- orientationIsLandscape
-
A Boolean specifying the initial value of the print parameter
orientation is landscape. This
defines whether the pages are to be printed in landscape orientation.
When True, pages are printed in landscape orientation. When False,
pages are printed in portrait orientation.
- paperHeight
-
A real number specifying the initial value of the print parameter
paper height. This defines the height of the
paper (in inches) for printing.
- paperWidth
-
A real number specifying the initial value of the print parameter
paper width. This defines the width of the
paper (in inches) for printing.
- parseFreeformText
-
A Boolean governing the parsing of freeform text.
If True, text between freeform text begin and end markers is parsed,
and if there is a syntax error, an error message is produced.
- parsingOn
-
A Boolean specifying whether the editor should initially be configured
with parsing-mode turned on. When True, parsing-mode is on; when
False, parsing-mode is off.
- preprocessorOk
-
A Boolean that specifies whether preprocessor directives are allowed.
- printCommand
-
A string specifying the initial value of the print parameter
print command. This is the command issued to
the operating system in order to print a document.
- printerIsColor
-
A Boolean that specifies the initial value of the print parameter
printer is color. This defines whether
documents should be printed with color information included. When True,
color information is included; when False, no color information is
included.
- printStyleDefinition
-
A string containing a list of style declarations that are
used to set the fonts and colors for the printing of documents. This
allows documents to be printed in styles that differ from those used
to display them on the screen. If this resource is not present, it
defaults to the styleDefinition resource, in which case the styles
used for printing will be the same as those used for display. The
format of a style definition is described in Section
Styles.
- prologPathname
-
A string specifying the initial value of the print parameter
prolog pathname. This parameter
gives the full or
relative pathname of the prolog, which is a
PostScript file that defines certain default printing behaviors.
The default value is aahome/PostScript.
- respectElision
-
A Boolean that specifies the initial value of the editor parameter
respect elision. It defines whether the
writing of text files should respect the specification of alternate
unparsing scheme for terms in the buffer. In general, alternate
unparsing is used to elide the display of terms. Note that setting
this resource True will mean that elided parts of terms will not
be saved, which may result in the loss of parts of files.
- reverseVideo
-
A Boolean that specifies whether reverse video should be used.
- rightMargin
-
A real number specifying the initial value of the print parameter
right margin. This gives the width (in
inches) from the right edge of the paper to the right edge of the text.
- scaleFactor
-
A real number specifying the initial value of the print parameter
scale factor. This indicates the factor by
which output is to be scaled when printed.
- scriptLanguage
-
A string specifying the current scripting language. This can be
either "scheme" or "tcl".
- scriptStartupFiles
-
A list of files separated by spaces, newlines, or commas, which
will be interpreted as scriptLanguage script files
when the editor starts up.
- scriptStartupString
-
A string that is parsed as Scheme code and interpreted when
Ada-ASSURED starts up.
- searchCategories
-
A list of strings, separated by newlines, that are displayed
in a List widget in the dialog box of the
structural-search command.
This list will assist users
of the structural-search command in selecting the syntactic
category of the search object.
- sendToPrinter
-
A Boolean specifying the initial value of the print parameter
send to printer. If True, output
is sent to the printer (by calling the print command); if False,
output is saved to a file (specified in destination file).
- shellExec
-
A string specifying the shell and shell arguments that are to be used
to execute commands generated by the shell-command,
compile, and grep commands.
- sortTransforms
-
A Boolean specifying whether items appearing in the Transforms
menu should be sorted. If True items appear sorted; if False
items appear in the order in which they were declared.
- styleDefinition
-
A string containing a list of style declarations that are
used to set fonts and colors for the unparsing of objects. The format
of a style definition is described in Section
Styles.
- tabStops
-
An integer specifying the initial value of the editor parameter
tab stops. It defines the spacing
between tab stops. The unit of width is the width of the
character M in the largest font in the styleDefinition.
- topMargin
-
A real number specifying the initial value of the print parameter
top margin. This gives the width (in
inches) from the top of the paper to the top of the text.
- transformLocation
-
A value that specifies the location in an editor window where selector
buttons for the current set of transforms will be displayed. The
possible values are:
-
| X |
contextPaneTransform buttons appear in the
context pane of the editor window.
|
| MS | N.A. |
- menuBarTransform buttons appear in a
pull-down menu titled Transforms on the
menu bar of the editor window. This is the default
value.
-
| X |
bothTransform buttons appear both in the
context pane and in the menu bar.
|
| MS | N.A. |
- noTransformsTransform buttons do not appear
in either location. Note that a transform can still be entered
from the command pane or execute-command dialog box.
- trimTrailingBlanks
-
A value that specifies whether trailing blanks are to be trimmed
upon writing files to disk in text format. If True, all
blanks at the end of a line are removed from the output.
- untouchableComments
-
The value is a string. If a comment begins with any character c
contained in this string, then the comment will not be reindented or
wrapped.
- useAbsoluteRightMargin
-
A Boolean specifying the initial value of the print parameter
use absolute right margin.
If True, line breaks are calculated so that each line contains at most
absolute right margin characters; if False, line breaks are calculated
based on the width of the printing area.
- user0
-
The full pathname of the enforcement parameter preference file,
or for brevity, just the full pathname of its parent directory. If
user0 is a directory, the enforcement file is
.aa_enforcement_params in that directory.
The default value is
| X | aahome/files |
| MS | aahome\files |
(a directory).
- user1
-
unused.
- user2
-
A
string that contains characters to be recognized as comment
continuation characters. Upon parsing, a line is recognized as a
continuation of a previous comment line if the previous line ended
with a comment, and the current line begins with the string
``--'' followed by one of the characters from the user2
string. The first character of the user2 string is distinguished
in that it is used as the comment continuation character upon output.
The default value is the string containing the single character
``+''.
- user3--user7
-
unused.
- warnOnLineOverflow
-
A Boolean value that specifies whether a warning is to be printed
when a file that is being written as text contains lines that cannot
be printed using the available width. The width is the value of the
editor parameter absolute right margin.
- warnOnWritingTextBuffers
-
A Boolean value that
specifies whether a warning is to be printed when a buffer is saved in text
format that contains unparsed text buffers.
- wordWrapAtAll
-
A
Boolean value that specifies the initial value of the editor parameter
word wrap. If True, objects are
prettyprinted with the width parameter taken from the width of the
window. If False, objects are prettyprinted with the width
parameter taken from the value of the editor parameter absolute
right margin.
- xlineCategories
-
A
string specifying a comma- or space-separated list of syntactic
categories for which external line numbers are to be noted on output.
X Windows
Ada-ASSURED resources are implemented by X resources, the
standard means by which a site, project, or individual can customize
the behavior of an X application. To give a value to the X resource
SynthesizerGenerator*fooBarBas is to give that value to the
Ada-ASSURED resource fooBarBas.
Standard resource initialization files are distributed with Ada-ASSURED.
Customizations to resources should be made in those files, or in local
copies of them.
X Resource Namespace
To define a resource value, you must first know its name. Resources
are either application or widget resources.
The names of application resources have one of the forms:
application-name*r
application-class*r
where r is the base name of the resource. The Ada 83 and Ada 95
applications in Ada-ASSURED, known as aa83 and aa95, are both
elements of the SynthesizerGenerator class. Thus, for example,
the two resources:
aa83*indentingSpaces
aa95*indentingSpaces
can be collectively be referred to as
SynthesizerGenerator*indentingSpaces
Ada-ASSURED's application resources are described in Section Application X Resources.
The names of widget resources depend on the structure of Ada-ASSURED's
widget hierarchy. The ``full path name'' of a widget resource is
w1*w2* ...*wn*r
where each wi is either a widget class, or a widget instance name,
or empty, and r is the base name of the resource. An empty wi is
a wildcard that matches anything.
Figure widget-hierarchy shows Ada-ASSURED's widget hierarchy. For each
member of the hierarchy, the class name is listed first. Class names
in sans serif font are standard Motif widget classes that are
documented in Motif release documentation. The class name
SynText, which is unique to Ada-ASSURED, is documented in Section SynText Widget X Resources. The
instance name follows the class name. Instance names in typewriter
font are constants. Instance names in boldface font
are variables and are explained in following notes to Figure
widget-hierarchy:
- This is aa83 or aa95,
depending on which editor is being used.
- The name that appears in the button, e.g. Help.
- Menu items are Buttons, Separators, Toggles or
Cascades. A Cascade has a XmRowColumn child, which can recursively
contain menu items.
- There are several separator-sash pairs. Most are usually unmapped.
- The name of the command that generates the dialog,
e.g. open. The children of the individual dialogs are
not shown here. If necessary, these can be extracted using
editres as described below.
Setting X Resources
The X documentation provides detailed instructions on how to set and
change X resources. Here, we briefly describe two simple methods for
setting these resources.
X maintains a resource database for X applications. This can be
managed by the program xrdb.
One method of setting a resource is to edit a file that contains the
resource specification and then use xrdb to load that file into
the database. To load a resource file resources and override
all current resources in the database, use the following command:
xrdb -load resources
To merge the resource file with the existing database, use:
xrdb -merge resources
The standard distribution comes with a set of
Ada-ASSURED resource files. Each line of a resource
initialization file contains an assignment of the form:
resource-name: resource-value
A line can be continued by ending it with a backslash (\).
Resources can be set at startup time using the command-line flag
-xrm. For example, to run Ada-ASSURED with case-sensitive searching
enabled, invoke it as follows:
aa -xrm '*caseSensitiveSearch: True'
Editres
The editor responds to the EditRes protocol for setting resources.
Editres is a useful tool for browsing the widget hierarchy and constructing
resource files. This is a standard tool supplied with most X distributions.
To use, first invoke Ada-ASSURED. Then invoke editres, pulldown the Commands
menu and select Get Tree. Point the cursor at the editor window and
click. Editres will then display the widget hierarchy.
Application X Resources
The following resources are associated with the application class
SynthesizerGenerator:
SynText Widget X Resources
The SynText widget is an extension of the Motif XmPrimitive widget class.
The following table lists the new resources added to XmPrimitive and
inherited resources whose behavior is specific to the SynText widget.
Inherited resources are indicated with a (dagger).
- autoHScroll
-
A
Boolean value that, when True, specifies that the editor window
should do an automatic horizontal scroll in order to keep the
insertion cursor visible in the window. When the value is False,
the insertion cursor may ``disappear'' off the left or right
side of the window.
- background
-
The color to use as the default background color for all members of
the widget hierarchy.
- contextLabel
-
The string displayed in the context pane before the syntactic category
of the current structural selection.
- convertSelectionByFunction
-
Not relevant
to Ada-ASSURED.
- displayedKeybindings
-
A string that describes keybindings for commands. The resource is
used only for documentation, not for mapping keys to commands. (The
actual mapping used is defined by SynText widget resource
translations.) The first keybinding given for
a command will appear in any pull-down menu item for the command. The
entire list of keybindings appears in the describe-command
dialog box when the command is selected.
Each line of the string is separated from the next
line by a line-feed character and consists of two substrings
separated by one or more space characters. For example:
SynthesizerGenerator*displayedKeybindings: \
^C,^X^C exit \n\
X^2,Shift+F3 split-current-window \n\
Alt+\\, previous-name
The left substring on the line is a comma-separated list of
keybindings. This can be any string of characters that does not
include a space character. If a comma character is part of a
keybinding, it must be escaped. The right substring on a line is the
name of a Synthesizer Generator command. A warning will be issued at
editor invocation time if an invalid command occurs in the list. Note
that the correspondence between the list of displayed keybindings and
the actual keybindings given by the SynText widget's translations
resource is not checked.
- geometry
-
An X-format geometry string (e.g.,
400x400+1+1) that specifies the position of the initial window for
Ada-ASSURED.
- hasContextPane
-
A Boolean that specifies whether browsers should have a context pane.
- insertPosTimeOut
-
An integer that is the amount of time in milliseconds that
will elapse between the movement of the insertion cursor to a new
location and the tracking of the structural selection to that
location. If the insertion cursor is again moved before this time-out
elapses, the time-out will be cancelled and a new one will be issued
for the new insertion-cursor location.
- normalCursor
-
A string value that is the name of a standard X cursor that is
normally displayed in Ada-ASSURED.
- scannerEscapeConversion
-
A character that specifies the translation for the
scanner-escape character for glyph conversion in selection requests
from other processes. When another process makes a selection request
from an editor and the selection contains non ISO-Latin1
glyphs, those glyphs are
converted to the respective scanner-input sequence for the glyph. The
scanner-escape character that initiates the input sequence is
frequently a non-printing character, which violates the X ICCCM
protocol for selection transmission. This resource supplies a
printing character to use in place of the real
scanner-escape character.
- selectionTabsConversion
-
A string value that specifies the translation for tabs within the X
selection when a selection request is made by another process.
- tokenSeps
-
A string of characters that determine the separators between tokens.
A double mouse click at a text position expands the current selection
to a token. The extent of a token is determined by this
tokenSeps resource.
- translations
-
A string defining the translation table. The translation table
defines the relationship between events and actions. See the X
documentation on translations for further details on how to specify
events. Action eval-command
takes a list of parameters that define the command to be executed when
the event occurs. The first parameter is the name of the command, and
subsequent parameters are parameters to that command.
- underlineColor
-
The color to use for drawing the underline indicating the structural
selection when the respective character is not highlighted (not within
the extended X selection).
- underlineDescent
-
The distance in pixels between the baseline of the displayed text and
the underline that denotes the structural selection. As underscore
characters usually coincide with the baseline, a value of zero may
cause the underlining to obscure the underscores.
- underlineInvertColor
-
The color to use for drawing the underline indicating the structural
selection when the respective character is highlighted (is within the
extended X selection).
- underlineWidth
-
The width in pixels of the line used to underline text that is the
structural selection.
- waitCursor
-
A string
value that is the name of a standard X cursor that is displayed when
the editor is ``waiting'', e.g. during attribution or while reading
a long file.
Microsoft® Windows®
Ada-ASSURED resources are implemented by Scheme Resource
Variables. To give a value to the Scheme variable sg:foo-bar-bas
is to give that value to the Ada-ASSURED resource fooBarBas.
The standard resource initialization files for Ada-ASSURED are:
aahome/files/aa_default_options.stk
aahome/Users/username/aa_options.stk
Customizations should be made in those files.
The aa_default_options.stk file is provided with the shipment,
and is the place for a system administrator to make
installation-standard customizations.
If a user's own aa_options.stk file exists, it is used instead of
the default file. User files are not provided with the shipment.
Scheme Resource Variables
The naming convention for the Scheme variables for Ada-ASSURED resources
is to prefix "sg:" to the resource name, then to replace every
upper case letter in the resource name by a hyphen (-) followed by
the lower case form of that letter. Thus the resource variables for
the Ada-ASSURED resources discussed in the example in
Ada-ASSURED Resources are as follows:
| Resource | Resource Variable | Class
|
| attributionOff | sg:attribution-off | Boolean
|
| absoluteRightMargin | sg:absolute-right-margin | Integer
|
| autoSaveNoFilePrefix | sg:auto-save-no-file-prefix | String
|
| bellType | sg:bell-type | Enumerated
|
Continuing that example, the code below shows how to set values for
each of the four classes. Note that both strings and enumerated
values are represented as Scheme strings.
(define sg:attribution-off #t)
(define sg:absolute-right-margin 80)
(define sg:auto-save-no-file-prefix "#")
(define sg:bell-type "audible")
Other Customizations
Some application resources under X windows have no direct
counterparts in Microsoft® Windows®. For example, the treatment of
key bindings is completely different from X. See the file
etc/sg_init.stk for examples and
documentation.
Styles
Regions of prettyprinted text are associated with styles that
determine the font, size, slant, weight, and color of symbols.
A style is defined as follows:
- Font
-
the name of a font in the set of fonts offered by the system, e.g.,
times, helvetica, cour.
- Size
-
defined in points in the range of the sizes
offered by the system.
- Slant
-
either italic, or normal (for
simplicity, italic subsumes italic and oblique).
- Weight
-
either bold or normal.
- Color
-
defined as a tuple with up to four components
< fN,bN,fI,bI >,
where f is a foreground color, b is
a background color, N is the normal representation, and I is
the reverse video representation. If any of the colors is missing,
it is inferred as follows: if bN is missing, it is assumed to be
bN of the default style (see below); if fI is missing, it is
assumed to be bN; and if bI is missing, it is assumed to be
fN.
A style template
is a collection of modifications to an existing
style. The style transformation function T takes a style and a
style template and produces a new style. A style template contains
the same number of fields as a style, but some of the fields may be
empty, in which case T treats them as identity modifications. If
all fields are empty, the style transformation function is the
identity function, i.e., it has no effect.
T is defined for each field of the template as follows:
- Font
-
As defined for styles, the new style will be in
this new font.
- Size
-
As defined for styles, the new style will have the
new size.
- Slant modifier
-
Either +italic to turn italic on
for the new style, -italic to turn it off, or !italic to
toggle between on and off.
- Weight modifier
-
Either +bold to turn bold on
for the new style, -bold to turn it off, or !bold to
toggle between on and off.
- Color modifier
-
A tuple with up to four
components consisting of color names or the identity name *. If a name is
missing it is inferred as defined for styles. The color in the new
style is taken from the appropriate name in the modifier, or is
unchanged if the name is *.
If all the fields in a style template are present, T completely
overrides the old style.
Each generated editor is associated with a collection of style-template names.
Style-template names are bound to style
templates using the X application-level resources styleDefinition
and printStyleDefinition.
Styles are derived by successively applying templates to the default
style. The default style is generated by applying the default
template to a ``root'' style that is generated when Ada-ASSURED is
invoked. The root style is originally the only full style and is
defined as follows:
- Font
-
is taken from the font resource.
- Size
-
is taken from the size of XtDefaultFont
resource. If this resource is undefined, the size will be 14.
- Slant
-
is normal.
- Weight
-
is normal.
- Color
-
is < fg, bg, bg, fg > where
fg is the color specified in the foreground resource, or
black if undefined; and bg is the color specified in the
background resource, or white if undefined.
Certain reserved style-template names are used to control
inter-line spacing and the appearance of text buffers and newly typed
characters. The reserved style-template names are as follows:
- default
-
The default style is generated by
applying this template to the root style (see above). Normally, the
user will define this to be a fully instantiated style. Unless
specified otherwise, all characters will appear in this style.
The default is the identity template.
- largest
-
This is a template that is applied to the
default style to produce the style that will be used to calculate
inter-line spacings. It should be as large as or larger than the
actual largest style used. The default is the identity template.
- new-text-buffers
-
A style template that is applied to
each character of a newly captured text buffer. The default is the
identity template.
- new-characters
-
This is applied to the style of an
appropriate neighboring character in order to determine the style of a
character newly entered in a text buffer. The neighboring character
is either the one to the left or the right that is in the same text
buffer. If the text buffer is empty, then the source style is the
default style. The style will not be taken from a neighbor that is a
glyph. In such a case, the new-characters style template is
applied to the default style. The default is the identity template.
- old-text-buffers
-
This is the template that is applied
to each character of an existing text buffer when the structural
selection is moved away from the text buffer. The default is the identity
template.
- text-buffers-in-another-view
-
A region that is not text-capturable
because it has a text buffer active in another view will have this
template applied to the style of its normal presentation.
The default is the identity template.
- Text
-
Nodes of syntactic category TEXT appear in the style that is the result
of applying this template to the default style.
The following styles are specific to Ada-ASSURED and can be
customized. In order for the feature of Ada-ASSURED that aligns
identifiers vertically to work correctly, fonts used in these styles
must be fixed width.
- Background
-
The style in which ellipses are displayed.
- Comment
-
The style in which comments are displayed.
- CommentedOut
-
The style in which commented out items are displayed.
- Error
-
The style in which errors are displayed.
- Preprocessor
-
The style in which preprocessor directives and dollar-prefixed
identifiers are displayed.
- Violation
-
The style in which style violation messages are displayed.
- Indicator
-
The style in which indicators are displayed.
- Keyword
-
The style in which keywords are displayed.
- Placeholder
-
The style in which placeholders are displayed.