All ROSE-specific widgets can handle/display SgNode's and have some common signals and slots. There are two SgNode "input"-functions (slots) and two "output"-functions (signals) which every ROSE-widget should have. The link mechanism (see MDI-Widget-Creator Interface) uses these signals/slots to connect two ROSE-widgets together.
setNode() Takes the given node as base for the whole display. TreeView's usually set the new node as root.gotoNode() Selects the given node (and in tree-view expands until this node is visible), and highlights it, the displayed data set does not changenodeActivated() This signal is usually sent when the user clicks on some nodenodeActivatedAlt() Alternative way of activating a node, mostly double-click (but may vary from view to view)
Normally setNode() is connected with nodeActivated() and gotoNode() with nodeActivatedAlt()
setFilter() which can be used to show only part's of the AST. For a more detailed documentation see AstFilterInterface and the derived classes. setFilter(). The class should take ownership of the filter and free it when it's not needed any more.Uses node->get_file_info() to display the original source code (NOT the unparsed code) setNode() and getNode() load the file where the SgNode occures in and sets the cursor at the right position (start_of_construct)
Features:
This view shows a Qt-TreeView of a Sage-AST.
For changing the display call setNode() which sets a new rootNode or gotoNode() which selects a given node
If the user clicks on a node the signal nodeActivated() is emitted, on when double clicking nodeActivatedAlt() is called
It's possible to filter the view with an AstFilterInterface. For example filtering out all nodes which are part of header files etc.
To get icons and node-descriptions the functions in namespace AstDisplayInfo are used
A custom model is used for respresenting the AST: QtAstModel
This widget shows the AST layouted as a tree. For actual layouting the class TreeLayoutGenerator is used, but this can be replaced easily (for example to use different algorithms, or layout a general graph instead of a tree)
The actual code for displaying the nodes and edges is implemented in DisplayTreeNode and DisplayEdge
Displays a callgraph associated with a project, and layouts it with a spring embedder algorithm uses the ProjectManager to build up a callgraph
This view is intended for user which are not familiar with the ROSE data structures, it presents a view of the code including only elements a C++ developer should be familiar with (classes, namespaces,functions etc)
There are two usage modes:
This class doesn't depend on rose, the rose specific version for displaying MetricAttributes is MetricsKiviat
Declaration of Metrics Config Class for local configurations
Shows following information about an SgNode:
You can use this mechanism in your GUI by creating a SubWindowFactory which is a QMdiArea. For a more detailed description see the documentation of SubWindowFactory and WidgetCreatorInterface.
1.4.7