The belvuApp module contains the code for the Belvu application.
main()
function
The Belvu main()
function lives in belvuMain.c
. The main()
function performs the following jobs.
-T R
was given;
belvuWindow.h/.c
We use GTK+ widgets to create the Belvu graphical components. The main Belvu window is created by the createBelvuWindow()
function in belvuWindow.c
.
A Belvu window comprises the following components:
belvuAlignment.h/.c
This is the main portion of the Belvu window and shows the actual alignment. There are two main modes for this window: normal and 'wrapped'. The normal mode is currently only used for the alignment in the main window. The wrapped mode is used whenever we create a wrapped-alignment window for printing; we can have as many wrapped-alignment windows as we like.
In normal mode, there are two drawing areas: one for the static columns such as name, start and end; these do not scroll horizontally (although they do scroll vertically). The other drawing area displays the sequence data, and scrolls both horizontally and vertically. In wrapped mode, only the sequence area is displayed (although sequence names are still drawn, they are all drawn inside the one widget and the whole thing scrolls together). Since the sequence area always exists, this widget controls the vertical scrolling; if the columns area also exists, it is scrolled in sync with the sequence area.
In normal mode, the user will be interacting with the widget a lot, so update speed is essential; therefore, only the currently-visible characters are drawn. Wrapped mode, however, is designed for printing, so the whole area must be drawn, which can be slow. There is also a limitation on the size of this window because we use a GdkPixmap to do the drawing, and we get a crash if we request a GdkPixmap that is too large (this appears to be undocumented, so we have had to guess a reasonable upper limit on the size). The size limit is unlikley to be a problem though seeing as this window is intended to be printed, and the maximum window size is already much larger than anyone would reasonably want to print.
belvuTree.h/.c
This window displays the tree. There is only ever one tree (stored in the main context), and it must be calculated before the tree window can be shown. The underlying tree must be recalculated whenever it is invalidated by making changes such as deleting sequences or columns; we don't recalculate the tree automatically because it can take a long time and the user may have further edits to make. The tree window must therefore be able to handle an invalid (null) tree until the user requests it to be recalculated. There is only ever one tree window; if the user re-opens it, we re-display the original window.
belvuConstPlot.h/.c
This window shows the plot of the conservation profile. There is only ever one conservation plot window.
This displays a list of all the annotation lines. There is only ever one annotation window. It is currently only available if requested on the command-line, and cannot be reopened if closed; it would make more sense to be able to open it from within the program.