Appendix A. Customizing the C++ Browser

The C++ Browser lets you customize your display and the way you work with reference pages (man pages). These formats are implemented as X application resources that you can redefine in your local .Xdefaults file. After editing it, run xrdb .Xdefaults and then reopen the Static Analyzer.

This appendix covers these topics:

Customizing the Browser View Lists

This section shows you how to customize the outline formats of Browser View lists by applying your own keyword headers and rearranging the features of each list.

Member List Resource

The layout of the Browser View member list is controlled by this resource:

Cvstatic*memberOrder

The general format of this resource is as follows:

Level-1-keyword: HEADING [keyword], HEADING [keyword],..; Level-2-keyword: HEADING [keyword], HEADING [keyword],...; Level-3-keyword: HEADING [keyword], HEADING [keyword],...;

The three level keywords are Protection, Scope, and Member. The order in which these are used determines the level of nesting in the outline list used for protection, scope, and member headings, respectively.

Headings may consist of any string you choose to describe the heading category. The headings listed with the level-1 keyword become top-level headings in the outline list, the level-2 headings appear indented under each of the level-1 headings, and the level-3 headings appear indented beneath each of the level-2 headings.

Each heading in a level has an associated keyword that determines the sort of items that appear under the heading. The allowable keywords are as follows for each associated level keyword:

Protection: 

[public], [protected], [private]

Scope: 

[instance], [static]

Member: 

[type], [data], [method], [virtualmethod]

It is also possible to combine the types associated with two or more keywords under one heading by using the construction for any given heading:

HEADING [keyword1+keyword2+...]

You can also control whether a heading is expanded or collapsed when the browser starts up. Placing an asterisk (*) at the end of the heading string causes that heading to be collapsed by default:

HEADING* [keyword]

The default assignment for the outline resource of the member list can be found in /usr/lib/X11/app-defaults/Cvstatic. The contents of the file appear below:

Cvstatic*memberOrder:  Protection: PUBLIC [public], PROTECTED* [protected], PRIVATE* [private]; Scope: INSTANCE [instance], STATIC [static]; Member: TYPE* [type], DATA [data], METHODS [method], VIRTUAL_METHODS [virtualmethod];


Note: The sample above is a single line.

You can override this definition by placing your own definition in your local .Xdefaults file. For example, to make the display look like the sample in Figure A-1, add this line:

Cvstatic*memberOrder: Member: IS (Type) [type], Data Members--------------------- [data],
Methods----------------------------- [method], Virtual
Methods-------------------- [virtualmethod]; Scope:
Non-Static [instance], Static [static]; Protection: Private
[private], Protected [protected], Public [public];

Related Class List Resource

The layout of the Browser View related class list is controlled by this resource:

Cvstatic*relationOrder

The construction of this resource is similar to the member list, but simpler:

HEADING [keyword], HEADING [keyword],...

The headings and keywords work as described for the member list, but there is no concept of level keywords in the related class list.

The allowable keywords for the related class list are as follows:

[base], [derived], [uses], [usedby], [friendfunction], [friend], [friendof]


Note: In the related class list, headings cannot contain multiple keywords, as they can in the member list.

As in the member list, you can control whether a heading in the related class list is expanded or collapsed when the browser starts up. Placing an asterisk (*) at the end of the heading string causes that heading to be collapsed by default:

HEADING* [keyword]

The default assignment for the related class list outline resource can be found in /usr/lib/X11/app-defaults/Cvstatic, and is listed below for your convenience:

Cvstatic*relationOrder: BASE CLASSES [base], DERIVED CLASSES [derived], USES [uses], USED BY [usedby], FRIEND FUNCTIONS [friendfunction], FRIENDS [friend], FRIEND OF [friendof]

You can override this definition by placing your own definition in your local .Xdefaults file. For example, for the display shown in Figure A-1, try this:

Cvstatic*relationOrder: Parent Classes [base], Child Classes [derived], Used Classes [uses], User Classes [usedby], Friend Functions [friendfunction], Friend Classes [friend], Friend Of [friendof]

Other Browser View List Resources

XWindows resources listed in this section, found in /usr/lib/X11/app-defaults/Cvstatic, can be modified in your local .Xdefaults file. The default values are listed with each resource. You can set any true value to false.

Cvstatic*completeClassName: true 


enables ClassName completion; by typing a space in the current class field, you complete a class name from the list of classes in the fileset (if set to true, as it is by default).

Cvstatic*showMessageArea: true 


enables the message area in the Browser View window (if set to true, as it is by default).

Cvstatic*scream: true 


enables warning beeps when there are 0 results for a query, or when a class name has more than one completion in the current class field (if set to true, as it is by default).

Cvstatic*indentationWidth: 15 


sets the indentation in the outline lists in pixels. Figure A-1 shows the making the following change to the resource:

Cvstatic*indentationWidth: 10

Cvstatic*nameAlign: true 


aligns names of the members under the same parent so that the type declarations and member (variable and function) names form left-justified columns (if set to true, as it is by default).

Cvstatic*arglistAlign: true 


aligns the argument lists of member functions under the same parent so they form a left-justified column (if set to true, as it is by default).

Cvstatic*sort: true  


sorts items in the outline lists based on the value of the entire string denoting an item (if set to true, as it is by default). For example, given two members, void f and int k, the C++ Browser lists int k before void f in the list.

Cvstatic*nameSort: true 


sorts items in the outline lists based on the string value of the name of a member (if set to true, as it is by default). For example, void f would be listed before int k).

Using both of the previous resources in conjunction sorts first by type and then by name, as shown in Table A-1.

Table A-1. Sort Resources for Outline Lists

sort

name

Sort effect

false

false

Members are in declaration order

false

true

Members are sorted based on the name and not on type or return type. This behavior is shown in Figure A-1.

true

false

Members are sorted based on the their return type or type. Within the same return type, members appear in declaration order.

true

true

Members are sorted both on their type or return type and their name. This is the default behavior.

Figure A-1 shows the Browser View display using the sample resources set in .Xdefaults.

Figure A-1. Customized Browser View Display

Figure A-1 Customized Browser View Display

Customizing Reference Page Generation

The resources in this section are associated with the Man Pages for Classes window, available from the Browser View Admin menu item "Generate Man Pages."

Cvstatic*manPageDirPath: <default manpage directory path>  


The default is the current directory (.). To place generated reference pages in the windTunnel directory (that you have created) use this:

Cvstatic*manPageDirPath: ./manpage/windTunnel

Cvstatic*manPageSuffix: .<suffix>  


The default <suffix> is 3. The name of a reference page is <class_name>.3. To change the suffix to 4, use this:

Cvstatic*manPageSuffix: .4

Cvstatic*manPageViewCommand: <commands> 


Pressing the View button in the Man Pages for Classes window executes the command specified by this resource. The argument given is the set of reference pages for the classes that are selected. By default, View displays the most recently generated reference page in a read-only window. The default commands are:

Cvstatic*manPageViewCommand: winterm -H -c man -d

Cvstatic*manPageCopyRightMessage: <string>  


The default string is "Copyright 1994 by Silicon Graphics." A customized example is:

Cvstatic*manPageCopyRightMessage: Copyright 1994 by Fred Smythe