This chapter describes the data which is needed to configure OpenCAGE, and the mechanisms how data is given to the objects which need this data.
OpenCAGE needs some sets of information about displaying different kind of data. For example, the colors of the edges is not hard-coded, but it can be changed according to your wishes. The configuration is hold in an external file called oc.xml which is in the same path as the executable file "oc". The structure of the file is plain wellformed XML which can be read by the xml-processor of your choice. At the startup of OpenCAGE this file is parsed and the parameters and the data are delieverd to objects which need them.
The following information is hold in the configuration file oc.xml:
The menu for the workbench
These entries describe the menu entries in the workbench and the command which is executed when clicking on this entry.
The buttons displayed in the toolbar
These entries declare the commands which are available through the toolbar. You can adjust pixmaps and mark buttons as toggle-buttons.
The available analyses in the Analysis-Master
The menu-items for the context-menu of the Window-Master
The context-menus for all items in the graph-area
This part defines the menu-items, default-commands (when double-clicking) and allows hierarchical organisation of menu-items. For each kind of object (RFG-View, RFG-Composite, RFG-Source-Node, RFG-Edge) there is a separate menu-definition.
The format of the name which is displayed as a part of a node can be adjusted.
The positions the attributes of a node are drawn at
Merging of menus is possible
The colors of the edges
Note:
The pixmaps of the nodes cannot be changed by the configuration because the name of the pixmap files are determined via the type of the node.
Changes on the configuration take effect only after a restart of OpenCAGE
OpenCAGE will fail if one of these data is not present.
Adding new items into menus can be done without knowing the details of the implementation of the Display.
The appearance of OpenCAGE can be changed by exchanging only one file without recompiling.
Commands are determined by their unique name.
For an easy handling use paramter pots! First create an object which is initialized at startup before the reading of the XML will be done. Then adjust Init_XML in opencage-init and add a call of an appropriate method of this object and pass the read paramter pot to it.
A part of the implementation is done. But the partitioning into program and project data is still missing. You can find some of these parameters in the file oc.xml, but here is a quick guide how you can implement and store the missing parameters:
Use a Parameter_Pot (Parameter Pot (PP), the Section called Parameter Pot (PP) in Chapter 10) to deserialize the XML file in which the parameters are stored. Then append this Parameter_Pot to every other Parameter_Pot which could eventually use a parameter from the presets. That's all.