Cadabra
Computer algebra system for field theory problems
Public Member Functions | List of all members
cadabra::GUIBase Class Referenceabstract

Description

Abstract base class with methods that need to be implemented by any GUI.

You need to derive from this class as well as from the DocumentThread class.

#include <GUIBase.hh>

Inheritance diagram for cadabra::GUIBase:
cadabra::NotebookWindow

Public Member Functions

virtual void update_cell (const DTree &, DTree::iterator)=0
 The basic manipulations that a GUI needs to implement are adding, removing and updating (refreshing the display of) a cell. More...
 
virtual void remove_cell (const DTree &, DTree::iterator)=0
 Remove a single cell together with all its child cells. More...
 
virtual void remove_all_cells ()=0
 Remove all GUI cells from the display (used as a quick way to clear all before loading a new document). More...
 
virtual void add_cell (const DTree &, DTree::iterator, bool visible)=0
 Add a GUI cell corresponding to the document cell at the iterator. More...
 
virtual void position_cursor (const DTree &, DTree::iterator, int)=0
 Position the cursor in the current canvas in the widget corresponding to the indicated cell. More...
 
virtual size_t get_cursor_position (const DTree &, DTree::iterator)=0
 Retrieve the position of the cursor in the current cell. More...
 
virtual void on_connect ()=0
 Network status is propagated from the ComputeThread to the GUI using the following methods. More...
 
virtual void on_disconnect (const std::string &reason)=0
 
virtual void on_network_error ()=0
 
virtual void on_kernel_runstatus (bool)=0
 
virtual void process_data ()=0
 When the ComputeThread needs to modify the document, it stores an ActionBase object on the stack (see the DocumenThread class) and then wakes up the GUI thread signalling it to process this action. More...
 

Member Function Documentation

◆ add_cell()

virtual void cadabra::GUIBase::add_cell ( const DTree ,
DTree::iterator  ,
bool  visible 
)
pure virtual

Add a GUI cell corresponding to the document cell at the iterator.

The GUI needs to figure out from the location of this cell in the DTree where to insert the cell in the visual display. If the 'visible' flag is false, hide the cell from view independent of whether its hidden flag is set (this is only used when constructing a document on load time and we do not want to show cells until they have all been added to the document).

Implemented in cadabra::NotebookWindow.

◆ get_cursor_position()

virtual size_t cadabra::GUIBase::get_cursor_position ( const DTree ,
DTree::iterator   
)
pure virtual

Retrieve the position of the cursor in the current cell.

Implemented in cadabra::NotebookWindow.

◆ on_connect()

virtual void cadabra::GUIBase::on_connect ( )
pure virtual

Network status is propagated from the ComputeThread to the GUI using the following methods.

These get called on the compute thread (as opposed to the functions above, which get called on the gui thread).

Implemented in cadabra::NotebookWindow.

◆ on_disconnect()

virtual void cadabra::GUIBase::on_disconnect ( const std::string &  reason)
pure virtual

Implemented in cadabra::NotebookWindow.

◆ on_kernel_runstatus()

virtual void cadabra::GUIBase::on_kernel_runstatus ( bool  )
pure virtual

Implemented in cadabra::NotebookWindow.

◆ on_network_error()

virtual void cadabra::GUIBase::on_network_error ( )
pure virtual

Implemented in cadabra::NotebookWindow.

◆ position_cursor()

virtual void cadabra::GUIBase::position_cursor ( const DTree ,
DTree::iterator  ,
int   
)
pure virtual

Position the cursor in the current canvas in the widget corresponding to the indicated cell.

Implemented in cadabra::NotebookWindow.

◆ process_data()

virtual void cadabra::GUIBase::process_data ( )
pure virtual

When the ComputeThread needs to modify the document, it stores an ActionBase object on the stack (see the DocumenThread class) and then wakes up the GUI thread signalling it to process this action.

The following member should wake up the GUI thread and make it enter the processing part.

Implemented in cadabra::NotebookWindow.

◆ remove_all_cells()

virtual void cadabra::GUIBase::remove_all_cells ( )
pure virtual

Remove all GUI cells from the display (used as a quick way to clear all before loading a new document).

Implemented in cadabra::NotebookWindow.

◆ remove_cell()

virtual void cadabra::GUIBase::remove_cell ( const DTree ,
DTree::iterator   
)
pure virtual

Remove a single cell together with all its child cells.

Some toolkits (e.g. Gtk) will take care of that entire child tree removal automatically, in which case the only thing that needs done for the child cells is to remove any reference to their VisualCells.

Implemented in cadabra::NotebookWindow.

◆ update_cell()

virtual void cadabra::GUIBase::update_cell ( const DTree ,
DTree::iterator   
)
pure virtual

The basic manipulations that a GUI needs to implement are adding, removing and updating (refreshing the display of) a cell.

The code in DocumentThread will call these to make the GUI update its display. Called on the document thread.

Implemented in cadabra::NotebookWindow.


The documentation for this class was generated from the following file: