wxMaxima
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
wxMaxima Class Reference
Inheritance diagram for wxMaxima:
[legend]
Collaboration diagram for wxMaxima:
[legend]

Data Structures

struct  ServerDeleter
 The Right Way to delete a wxSocketServer. More...
 
class  VersionNumber
 A version number that can be compared using "<" and ">". More...
 

Public Types

enum  TimerIDs { KEYBOARD_INACTIVITY_TIMER_ID , AUTO_SAVE_TIMER_ID , MAXIMA_STDOUT_POLL_ID }
 An enum of individual IDs for all timers this class handles. More...
 

Public Member Functions

 wxMaxima (wxWindow *parent, int id, const wxString &title, const wxString &filename=wxEmptyString, const wxString &initialWorksheetContents=wxEmptyString, const wxPoint pos=wxDefaultPosition, const wxSize size=wxDefaultSize)
 
wxString EscapeFilenameForShell (wxString name)
 
bool ExitOnErrorArmed () const
 Is THIS worksheet still set to exit on a Maxima error?
 
void OnTimerEvent (wxTimerEvent &event)
 Is triggered when a timer this class is responsible for requires.
 
void ShowTip (bool force)
 
void EvalOnStartup (bool eval)
 Do we want to evaluate the document on startup?
 
void ExitAfterEval (bool exitaftereval)
 Do we want to exit the program after evaluation?
 
bool IsInteractive () const
 Is this an interactive session (as opposed to a batch run that will exit)?
 
void StripLispComments (wxString &s)
 Remove empty statements.
 
void LaunchHelpBrowser (wxString uri)
 Launches the help browser on the uri passed as an argument.
 
bool DocumentSaved ()
 Does this document need saving?
 
void LoadImage (const wxString &file)
 Load an image from a file into the worksheet.
 
void ShowToolBar (bool show)
 Shows or hides the toolbar.
 
void UpdateRecentDocuments ()
 Update the recent documents list.
 
void PopulateRecentDocumentsMenu (wxMenu *menu, int firstEntry, const std::list< wxString > &items)
 Used by UpdateRecentDocuments for populating a menu.
 
void PopulateRecentPackagesMenu (wxMenu *menu, int firstEntry, const std::list< wxString > &items)
 Used by UpdateRecentPackages for populating a menu.
 
bool IsPaneDisplayed (int id)
 true, if a Pane is currently enabled
 
void ShowPane (int id, bool show=true)
 Show or hide a sidebar.
 
bool IsXMLInspectorShown ()
 Is the XML inspector shown?
 
bool IsPerformanceMonitorShown ()
 Is the performance monitor shown?
 
void ToggleXMLInspector ()
 Hide or unhide the XML inspector.
 
void ToggleLogPane ()
 Toggle the visibility of the log pane.
 
void ShowWizardPane (wxString title)
 Show the pane the wizards are in.
 
void HideWizardPane ()
 
void TogglePaneVisibility (int id)
 Hides or unhides the pane with the given ID.
 
void AddToHistory (const wxString &cmd)
 Adds a command to the list of recently used maxima commands.
 
void EvaluationQueueLength (int length, int numberOfCommands=-1)
 Inform the user about the length of the evaluation queue.
 
void AuiManagerUpdate ()
 Updates the AUI manager and re-asserts the menu bar on GTK to prevent it from disappearing.
 
void StatusMaximaBusy (StatusBar::MaximaStatus status)
 Set the status according to if maxima is calculating.
 
StatusBar::MaximaStatus StatusMaximaBusy () const
 The status Maxima is currently displayed as being in.
 
void UpdateStatusMaximaBusy ()
 
bool HasPendingStatusText () const
 True if StatusText() recorded a left-half status text not yet shown.
 
void ClearPendingStatusText ()
 Mark the pending left-half status text as having been displayed.
 
const wxString & GetLeftStatusText () const
 The pending text for the left half of the status bar.
 
void StatusSaveStart ()
 Set the status to "Maxima is saving".
 
void StatusSaveFinished ()
 Set the status to "Maxima has finished saving".
 
void StatusSaveFailed ()
 Set the status to "Saving has failed".
 
void StatusExportStart ()
 Set the status to "Maxima is exporting".
 
void StatusExportFinished ()
 Set the status to "Maxima has finished exporting".
 
void StatusExportFailed ()
 Set the status to "Exporting has failed".
 
ConfigurationGetConfiguration ()
 
const std::unordered_map< int, wxString > & GetSidebarNames () const
 Get the list of human-readable sidebarnames and IDs.
 
void StatusText (const wxString &text, bool saveInLog=true)
 

Static Public Member Functions

static void ExitOnError ()
 Exit if we encounter an error.
 
static bool GetExitOnError ()
 Do we exit if we encounter an error?
 
static void EnableIPC ()
 Allow maxima to click buttons in wxMaxima.
 
static bool GetEnableIPC ()
 Do we allow maxima to click buttons in wxMaxima?
 
static void ExtraMaximaArgs (const wxString &args)
 Additional maxima arguments from the command line.
 
static wxString ExtraMaximaArgs ()
 Which additional maxima arguments did we get from the command line?
 
static void Set_Maxima_Commandline_Filename (const wxString &filename)
 Use this maxima command (from a command line option) instead of the configured path.
 
static const wxString Get_Maxima_Commandline_Filename ()
 The maxima command, if we use the –maxima=<str> command. If empty we use the configured path, not a command line option –maxima=<str>.
 
static int GetExitCode ()
 
static std::size_t CountWindows ()
 

Data Fields

wxTimer m_maximaStdoutPollTimer
 A timer that polls for output from the maxima process.
 

Static Public Attributes

static const wxString m_promptSuffix
 The marker for the end of a input prompt.
 

Protected Member Functions

void CommandWiz (const wxString &title, const wxString &description, const wxString &description_tooltip, const wxString &commandRule, wxString label1, wxString defaultval1, wxString tooltip1={}, wxString label2={}, wxString defaultval2={}, wxString tooltip2={}, wxString label3={}, wxString defaultval3={}, wxString tooltip3={}, wxString label4={}, wxString defaultval4={}, wxString tooltip4={}, wxString label5={}, wxString defaultval5={}, wxString tooltip5={}, wxString label6={}, wxString defaultval6={}, wxString tooltip6={}, wxString label7={}, wxString defaultval7={}, wxString tooltip7={}, wxString label8={}, wxString defaultval8={}, wxString tooltip8={}, wxString label9={}, wxString defaultval9={}, wxString tooltip9={}, wxString label10={}, wxString defaultval10={}, wxString tooltip10={})
 Invoke our standard wizard that generates maxima commands.
 
void OnFocus (wxFocusEvent &event)
 Called when this window is focussed or defocussed.
 
void PassKeyboardFocus ()
 Forwards the keyboard focus to a text control that might need it.
 
void OnMinimize (wxIconizeEvent &event)
 Called when this window is minimized.
 
void ConfigChanged ()
 Is called on start and whenever the configuration changes.
 
void OnJumpToError (wxCommandEvent &event)
 Called when the "Scroll to last error" button is pressed.
 
void OnSymbolAdd (wxCommandEvent &event)
 Sends a new char to the symbols sidebar.
 
void OnFollow (wxCommandEvent &event)
 Called when the "Scroll to currently evaluated" button is pressed.
 
void OnWizardAbort (wxCommandEvent &event)
 
void OnWizardOK (wxCommandEvent &event)
 
void OnWizardInsert (wxCommandEvent &event)
 
void OnWizardHelpButton (wxCommandEvent &event)
 
void ShowMaximaHelp (wxString={})
 Show the help for Maxima.
 
void ShowMaximaHelpWithoutAnchor ()
 Show the help for Maxima (without handling of anchors).
 
void ShowWxMaximaHelp ()
 Show the help for wxMaxima.
 
void ShowHelp (const wxString &keyword)
 Try to determine if help is needed for maxima or wxMaxima and show this help.
 
void CheckForUpdates (bool reportUpToDate=false)
 
void OnRecentDocument (wxCommandEvent &event)
 
void OnRecentPackage (wxCommandEvent &event)
 
void OnUnsavedDocument (wxCommandEvent &event)
 
void OnChar (wxKeyEvent &event)
 
void OnKeyDown (wxKeyEvent &event)
 
void OnIdle (wxIdleEvent &event)
 The idle task that refreshes the gui (worksheet, menus, title line,...)
 
void MenuCommand (const wxString &cmd)
 Inserts command cmd into the worksheet.
 
void ExportWorksheetToHtml (const wxString &filename, const wxString &flavor, bool embedWxmx)
 Export the current worksheet to an HTML file (driven by wxworksheettohtml).
 
void ExportWorksheetToTex (const wxString &filename, const wxString &documentclass, const wxString &documentclassOptions)
 Export the current worksheet to a LaTeX file (driven by wxworksheettotex).
 
void ReplaceSuggestion (wxCommandEvent &event)
 Processes clicks on suggestions Make the menu item, toolbars and panes visible that should be visible right now.
 
void UpdateMenus ()
 Enables and disables the Right menu buttons.
 
void UpdateToolBar ()
 Enables and disables the Right toolbar buttons.
 
void UpdateSlider ()
 Updates the slider to show the right frame.
 
void ShowPane (wxCommandEvent &event)
 Toggle the visibility of a pane.
 
void ChangeCellStyle (wxCommandEvent &event)
 Is triggered when the textstyle drop-down box's value is changed.
 
void OnFind (wxFindDialogEvent &event)
 Is triggered when the "Find" button in the search dialog is pressed.
 
void OnReplace (wxFindDialogEvent &event)
 Is triggered when the "Replace" button in the search dialog is pressed.
 
void OnReplaceAll (wxFindDialogEvent &event)
 Is triggered when the "Replace All" button in the search dialog is pressed.
 
void AddDrawParameter (wxString cmd, int dimensionsOfNewDrawCommand=2)
 Add a parameter to a draw command.
 
void VarReadEvent (wxCommandEvent &event)
 Spawn the "configure" menu.
 
void VarAddAllEvent (wxCommandEvent &event)
 Trigger adding all variables to the variables sidebar.
 
void SliderEvent (wxScrollEvent &event)
 
void NetworkDClick (wxMouseEvent &ev)
 Issued on double click on the network status.
 
void MaximaDClick (wxMouseEvent &ev)
 Issued on double click on the Maxima status icon.
 
void StatusMsgDClick (wxMouseEvent &ev)
 Issued on double click on the status message in the status bar.
 
void HistoryDClick (wxCommandEvent &event)
 Issued on double click on a history item.
 
void TableOfContentsSelection (wxListEvent &event)
 Issued on double click on a table of contents item.
 
void OnInspectorEvent (wxCommandEvent &ev)
 
void DumpProcessOutput ()
 
void TryUpdateInspector ()
 
bool UpdateDrawPane ()
 
wxString ExtractFirstExpression (const wxString &entry)
 
wxString GetDefaultEntry ()
 
void OnClose (wxCloseEvent &event)
 close wxMaxima window
 
wxString GetCommand (bool params=true)
 returns the command to start maxima
 
void ReadMaximaIPC (const wxString &data)
 
long long GetTotalCpuTime ()
 How much CPU time has been used by the system until now? Used by GetMaximaCPUPercentage.
 
long long GetMaximaCpuTime ()
 How much CPU time has maxima used till now? Used by GetMaximaCPUPercentage.
 
double GetMaximaCPUPercentage ()
 How much CPU horsepower is maxima using currently?
 
bool SaveNecessary ()
 Does this file contain anything worth saving?
 
void ResetTitle (bool saved, bool force=false)
 Update the title.
 
std::unique_ptr< GroupCellCreateTreeFromXMLNode (wxXmlNode *xmlcells, const wxString &wxmxfilename={})
 Loads a wxmx description.
 
bool SaveOnClose ()
 Try to save the file before closing it - or return false.
 
int SaveDocumentP ()
 Tries or offers to save the document.
 
void SetCWD (wxString file)
 Set the current working directory file I/O from maxima is relative to.
 
wxString GetCWD ()
 Get the current working directory file I/O from maxima is relative to.
 
void QuestionAnswered ()
 
void OnNewDemoFiles (wxCommandEvent &event)
 Is called when we get a new list of demo files Is called when we get a new list of demo files.
 
void OnUpdateTOCEvent (wxCommandEvent &event)
 Is called when something requests an update of the table of contents.
 
void OnNotificationClose (wxCommandEvent WXUNUSED(&event))
 Issued if a notification is closed.
 
void RemoveTempAutosavefile ()
 Remove an eventual temporary autosave file.
 
void ReReadConfig ()
 Re-read the configuration.
 
void ReadConfig ()
 Read the configuration from the OS's configuration storage.
 
void RegisterAutoSaveFile ()
 Remember a temporary autosave file name.
 
void DockAllSidebars (wxCommandEvent &ev)
 An instant single-window mode.
 
void HideAllSidebars (wxCommandEvent &ev)
 
wxString wxMaximaManualLocation ()
 
WorksheetGetWorksheet () const
 
virtual wxSize DoGetBestClientSize () const
 The default size for the window.
 
wxString GetDemoFile (wxWindowID id) const
 Looks up which demo file belongs to a wxWindowID.
 
void OnMenuStatusText (wxMenuEvent &event)
 
bool ToolbarIsShown ()
 

Protected Attributes

wxProcess * m_gnuplotProcess = NULL
 The gnuplot process info.
 
wxProcess * m_gnuplotTerminalQueryProcess = NULL
 Info about the gnuplot process we start for querying the terminals it supports.
 
wxString m_gnuplotProbedCommand
 The gnuplot command whose terminal support we already probed.
 
bool m_isActive = true
 Is this window active?
 
bool m_dataFromMaximaIs = false
 
wxString m_maximaVariable_display2d
 
wxString m_maximaVariable_altdisplay2d
 
wxString m_maximaVariable_engineeringFormat
 
bool m_readMaximaVariables = false
 
bool m_updateAutocompletion = true
 
std::unique_ptr< Maximam_client
 
std::unique_ptr< wxSocketServer, ServerDeleterm_server
 The server maxima connects to as client.
 
wxProcess * m_maximaProcess = NULL
 
wxInputStream * m_maximaStdout = NULL
 The stdout of the maxima process.
 
wxInputStream * m_maximaStderr = NULL
 The stderr of the maxima process.
 
wxOutputStream * m_maximaStdin = NULL
 The stdin of the maxima process. Normally unused (commands go over the socket), but sbcl's low-level debugger (LDB) reads from here, so we keep the stream to talk to LDB. See MaximaProcessManager::WriteToMaximaStdin.
 
bool m_inLDB = false
 True while sbcl is stopped in its low-level debugger (LDB). Set from the LDB banner on the process's stdout, cleared when the process ends. While set, user input is sent to Maxima's stdin (LDB) instead of the socket.
 
int m_port = -1
 The port the actual maxima process (not its wrapper script) runs at.
 
bool m_scheduleUpdateToc = false
 True = schedule an update of the table of contents.
 
bool m_dispReadOut = false
 what is displayed in statusbar
 
wxWindowIDRef m_gnuplot_process_id
 
wxWindowIDRef m_maxima_process_id
 
wxString m_lastPrompt
 
wxString m_firstPromptBuffer
 
wxString m_lastPath
 
std::unique_ptr< wxPrintData > m_printData
 
bool m_closing = false
 Did we tell maxima to close?
 
wxString m_maximaTempDir
 The directory with maxima's temp files.
 
wxString m_maximaHtmlDir
 
bool m_fileSaved = true
 
wxString m_gnuplotcommand
 Maxima's idea about gnuplot's location.
 
long m_commandIndex = -1
 
FindReplacePane::FindReplaceData m_findData
 
MathParser m_parser
 
bool m_maximaBusy = true
 
bool m_maximaError = false
 
Variablespanem_variablesPane = NULL
 The panel the user can display variable contents in.
 
TableOfContentsm_tableOfContents = NULL
 The table of contents pane.
 
Configuration m_configuration
 
std::size_t m_bytesFromMaxima = 0
 How many bytes did maxima send us until now?
 
long m_pid = -1
 The process id of maxima. Is determined by ReadFirstPrompt.
 
long m_maximaPid = -1
 The real process id of maxima (might be a child of m_pid).
 
wxString m_tempfileName
 The last name GetTempAutosavefileName() has returned.
 
StatusBarm_statusBar = NULL
 The status bar.
 
MainMenuBarm_MenuBar = NULL
 The menu bar.
 
wxMenu * m_demo_sub = NULL
 The "demo" sub-menu.
 
std::vector< wxMenu * > m_demoSubs
 The submenus for the various "demo" sub-submenus.
 
wxMenu * m_viewMenu = NULL
 The "view" menu.
 
wxMenu * m_gentranMenu = NULL
 The gentran menu.
 
wxMenu * m_subst_Sub = NULL
 The subst submenu.
 
wxMenu * m_logexpand_Sub = NULL
 The logexpand submenu.
 
wxMenu * m_FileMenu = NULL
 The file menu.
 
wxMenu * m_EditMenu = NULL
 The edit menu.
 
wxMenu * m_CellMenu = NULL
 The cell menu.
 
wxMenu * m_Edit_Zoom_Sub = NULL
 The zoom submenu.
 
wxMenu * m_Maxima_Panes_Sub = NULL
 The panes submenu.
 
wxMenu * m_EquationsMenu = NULL
 The equations menu.
 
wxMenu * m_MaximaMenu = NULL
 The maxima menu.
 
wxMenu * m_matrix_menu = NULL
 The matrix menu.
 
wxMenu * m_SimplifyMenu = NULL
 The simplify menu.
 
wxMenu * m_Simplify_Gamma_Sub = NULL
 The factorials and gamma submenu.
 
wxMenu * m_debugTypeMenu = NULL
 Contains the menu for the debugger trigger settingxc.
 
wxMenu * m_Simplify_Trig_Sub = NULL
 The trigonometric submenu.
 
wxMenu * m_Simplify_Complex_Sub = NULL
 The complex submenu.
 
wxMenu * m_CalculusMenu = NULL
 The calculus menu.
 
wxMenu * m_PlotMenu = NULL
 The plot menu.
 
wxMenu * m_listMenu = NULL
 The list menu.
 
wxMenu * m_NumericMenu = NULL
 The numeric menu.
 
wxMenu * m_HelpMenu = NULL
 The help menu.
 
ScrollingGenWizPanelm_wizard = NULL
 
long m_drawDimensions_last = -1
 Are we inside a 2d or 3d draw command?
 
DrawSidebarm_drawPane = NULL
 The sidebar with the draw commands.
 
std::array< wxString, 10 > m_statusTextHistory
 
std::unordered_map< wxWindowID, wxString > m_demoFilesIDs
 
SymbolsSidebarm_symbolsSidebar = NULL
 
int m_EvaluationQueueLength = 0
 The current length of the evaluation queue of commands we still need to send to maxima.
 
bool m_updateEvaluationQueueLengthDisplay = true
 Do we need to update the display showing the evaluation queue length?
 
int m_commandsLeftInCurrentCell = 0
 The number of commands left in the current of the evaluation queue item.
 
bool m_first = true
 Do we expect the 1st prompt from maxima to appear?
 
wxAuiManager m_manager
 The manager for dynamic screen layouts.
 
Worksheet *const m_worksheet = NULL
 The worksheet itself.
 
History *const m_history = NULL
 The history pane.
 
XmlInspectorm_xmlInspector = NULL
 A XmlInspector-like xml monitor.
 
PerformanceSidebarm_performanceSidebar = NULL
 The panel showing performance statistics.
 
RecentDocuments m_recentDocuments
 The panel the log and debug messages will appear on.
 
RecentDocuments m_recentPackages
 
wxMenu * m_recentDocumentsMenu = NULL
 
wxMenu * m_unsavedDocumentsMenu = NULL
 
wxMenu * m_recentPackagesMenu = NULL
 
wxMenu * m_autoSubscriptMenu = NULL
 
wxMenu * m_equationTypeMenuMenu = NULL
 
wxMenu * m_roundedMatrixParensMenu = NULL
 

Static Protected Attributes

static wxRegEx m_xmlOpeningTagName
 Finds the name of an opening tag.
 
static wxRegEx m_xmlOpeningTag
 Looks if this opening tag is actually complete.
 
static wxString m_mathPrefix1
 A marker for the start of maths.
 
static wxString m_mathPrefix2
 A marker for the start of maths.
 
static wxString m_promptPrefix
 The marker for the start of a input prompt.
 
static wxString m_firstPrompt
 The first prompt maxima will output.
 
static int m_exitCode = 0
 
static wxRegEx m_funRegEx
 
static wxRegEx m_varRegEx
 
static wxRegEx m_blankStatementRegEx
 
static wxRegEx m_sbclCompilationRegEx
 

Friends

class MaximaIPC
 
class MaximaCommandMenus
 The extracted menu-command handlers reach wxMaxima's services (MenuCommand, the wizards, m_configuration) through this friendship.
 
class MaximaResponseReader
 The extracted Maxima-response (Read*) handlers reach wxMaxima's services (the worksheet, the sidebars, the status bar, the configuration) through this friendship.
 
class MaximaProcessManager
 The extracted Maxima process/socket lifecycle reaches wxMaxima's services (the status bar, worksheet, configuration, process/socket members) through this friendship.
 
class MaximaEvaluator
 The extracted evaluation-queue driver reaches wxMaxima's services (the worksheet, the socket, the status bar, the configuration) through this friendship.
 
class MaximaFileIO
 The extracted worksheet file loaders/savers reach wxMaxima's services (the worksheet, the status bar, the title, the Maxima process) through this friendship.
 
class MaximaOutputAppender
 The extracted console output appenders reach wxMaxima's services (the worksheet, the parser, the status bar, the evaluator) through this friendship.
 

Member Enumeration Documentation

◆ TimerIDs

An enum of individual IDs for all timers this class handles.

Enumerator
KEYBOARD_INACTIVITY_TIMER_ID 

The keyboard was inactive long enough that we can attempt an auto-save.

AUTO_SAVE_TIMER_ID 

The time between two auto-saves has elapsed.

MAXIMA_STDOUT_POLL_ID 

We look if we got new data from maxima's stdout.

Member Function Documentation

◆ AddDrawParameter()

void wxMaxima::AddDrawParameter ( wxString  cmd,
int  dimensionsOfNewDrawCommand = 2 
)
protected

Add a parameter to a draw command.

Parameters
cmdThe parameter to add to the draw command
dimensionsOfNewDrawCommandThe number of dimensions the new draw command needs to have if we need to create one..

◆ DockAllSidebars()

void wxMaximaFrame::DockAllSidebars ( wxCommandEvent &  ev)
protectedinherited

An instant single-window mode.

A last resort if https://github.com/wxWidgets/wxWidgets/issues/18815 hinders one from re-docking windows.

◆ EnableIPC()

static void wxMaxima::EnableIPC ( )
inlinestatic

Allow maxima to click buttons in wxMaxima.

Disabled by default for security reasons

◆ ExitOnErrorArmed()

bool wxMaxima::ExitOnErrorArmed ( ) const
inline

Is THIS worksheet still set to exit on a Maxima error?

m_exitOnError records the process-wide –exit-on-error command line switch and must never be cleared, or one window clearing it would disable exit-on-error for every other window of a –single_process run (the multithreadtest CI hang: the first worksheet to finish its evaluation queue reset the shared flag, so a later error in a second worksheet dropped it into an interactive session that never exits). Whether exit-on-error is still armed once a worksheet has drained its own queue is therefore tracked per worksheet, here.

◆ ExportWorksheetToHtml()

void wxMaxima::ExportWorksheetToHtml ( const wxString &  filename,
const wxString &  flavor,
bool  embedWxmx 
)
protected

Export the current worksheet to an HTML file (driven by wxworksheettohtml).

Parameters
filenameThe (absolute) target file.
flavorThe equation flavor: "mathml", "mathjax", "svg" or "bitmap".
embedWxmxWhether to embed a downloadable .wxmx copy of the session.

◆ ExportWorksheetToTex()

void wxMaxima::ExportWorksheetToTex ( const wxString &  filename,
const wxString &  documentclass,
const wxString &  documentclassOptions 
)
protected

Export the current worksheet to a LaTeX file (driven by wxworksheettotex).

Parameters
filenameThe (absolute) target file.
documentclassOverrides the LaTeX document class (empty = keep the configured one).
documentclassOptionsOverrides the document-class options (empty = keep the configured ones).

◆ GetCommand()

wxString wxMaxima::GetCommand ( bool  params = true)
protected

returns the command to start maxima


Getting configuration

◆ GetMaximaCPUPercentage()

double wxMaxima::GetMaximaCPUPercentage ( )
protected

How much CPU horsepower is maxima using currently?

Returns
The percentage of the CPU horsepower maxima is using or -1, if this value is unknown.

◆ GetMaximaCpuTime()

long long wxMaxima::GetMaximaCpuTime ( )
protected

How much CPU time has maxima used till now? Used by GetMaximaCPUPercentage.

Returns
The CPU time maxima has used in the same unit as GetTotalCpuTime(); -1 means: Unable to determine this value.

◆ GetTotalCpuTime()

long long wxMaxima::GetTotalCpuTime ( )
protected

How much CPU time has been used by the system until now? Used by GetMaximaCPUPercentage.

Returns
The CPU time elapsed in the same unit as GetMaximaCpuTime(); -1 means: Unable to determine this value.

◆ IsInteractive()

bool wxMaxima::IsInteractive ( ) const
inline

Is this an interactive session (as opposed to a batch run that will exit)?

Returns false while we are batch-processing a file and will exit afterwards, true once we are (or have become) interactive. Use this to gate interactive- only work – help-anchor compilation, autocomplete symbol loading, the recent- documents list – so it is skipped in batch runs. AbortOnError() keeps m_exitAfterEval accurate: a Maxima error only turns a batch session interactive when we are not going to –exit-on-error.

◆ IsPaneDisplayed()

bool wxMaximaFrame::IsPaneDisplayed ( int  id)
inherited

true, if a Pane is currently enabled

Parameters
idThe event that toggles the visibility of the pane that is to be queried

◆ MenuCommand()

void wxMaxima::MenuCommand ( const wxString &  cmd)
protected

Inserts command cmd into the worksheet.


Menu and button events

◆ OnIdle()

void wxMaxima::OnIdle ( wxIdleEvent &  event)
protected

The idle task that refreshes the gui (worksheet, menus, title line,...)

In GUIs normally all events (mouse events, key presses,...) are put into a queue and then are executed one by one. This makes sure that they will be processed in order - but makes a gui a more or less single-processor-task.

This function now is called once every time the event queue is empty (which means: wxMaxima has caught up with all events from the GUI). An event.RequestMore() inside that function tells the OS to call OnIdle immediately again when OnIdl finishes while the event queue is still empty.

Moving things to the OnIdle() function makes them nearly feel like they were in a low-priority background thread without the disadvantage that background threads cannot access the GUI.

Moving the screen update to this function, as well, makes sure that if we get events faster than we can update the screen that doesn't cause lag, but causes screen updates for old events to be dropped if we already have new ones. This normally makes programs feel way more responsive.

The worksheet is additionally refreshed by a timer task in case that th computer is too busy to ever reach the idle task at all.


Idle event

◆ ReplaceSuggestion()

void wxMaxima::ReplaceSuggestion ( wxCommandEvent &  event)
protected

Processes clicks on suggestions Make the menu item, toolbars and panes visible that should be visible right now.

Tries to evaluate next group cell in queue.

◆ ResetTitle()

void wxMaxima::ResetTitle ( bool  saved,
bool  force = false 
)
protected

Update the title.

Updates the "saved" status, as well, but does only do anything if saved has changed or force is true.

Parameters
savedThe new "saved" status
forceForce update if the "saved" status hasn't changed.

◆ SaveDocumentP()

int wxMaxima::SaveDocumentP ( )
protected

Tries or offers to save the document.

If auto-save is on the document is automatically saved.

Returns
wxID_NO: No saving is necessary, currently

◆ SetCWD()

void wxMaxima::SetCWD ( wxString  file)
protected

Set the current working directory file I/O from maxima is relative to.

ServerEvent is triggered when maxima connects to the socket server.


Socket stuff


Maxima process stuff


Dealing with stuff read from the socket

◆ ShowPane() [1/2]

void wxMaximaFrame::ShowPane ( int  id,
bool  show = true 
)
inherited

Show or hide a sidebar.

Parameters
idThe type of the sidebar to show/hide
show
  • true: show the sidebar
  • false: hide it

◆ ShowPane() [2/2]

void wxMaxima::ShowPane ( wxCommandEvent &  event)
protected

Toggle the visibility of a pane.

Parameters
eventThe event that triggered calling this function.

◆ ShowTip()

void wxMaxima::ShowTip ( bool  force)

Tips and help

◆ ShowToolBar()

void wxMaximaFrame::ShowToolBar ( bool  show)
inherited

Shows or hides the toolbar.

Parameters
show
  • true: Show the toolbar
  • false: Hide the toolbar

◆ StatusMaximaBusy()

void wxMaximaFrame::StatusMaximaBusy ( StatusBar::MaximaStatus  status)
inlineinherited

Set the status according to if maxima is calculating.

Parameters
status
  • true: Maxima is calculating
  • false: Maxima is waiting for input

◆ StripLispComments()

void wxMaxima::StripLispComments ( wxString &  s)

Remove empty statements.

We need to remove any statement which would be considered empty and thus cause an error. Comments within non-empty expressions seem to be fine.

What we need to remove is any statements which are any amount of whitespace and any amount of comments, in any order, ended by a semicolon, and nothing else.

The most that should be left over is a single empty statement, ";".

Parameters
sThe command string from which to remove comment expressions.

◆ UpdateMenus()

void wxMaxima::UpdateMenus ( )
protected

Enables and disables the Right menu buttons.


Menu and button events

◆ UpdateRecentDocuments()

void wxMaximaFrame::UpdateRecentDocuments ( )
inherited

Update the recent documents list.

Copies the string array containing the list of recent documents to the recent documents menu.

◆ UpdateSlider()

void wxMaxima::UpdateSlider ( )
protected

Updates the slider to show the right frame.


Plot Slider

◆ VarReadEvent()

void wxMaxima::VarReadEvent ( wxCommandEvent &  event)
protected

Spawn the "configure" menu.

Todo:
Inform maxima about the new default plot window size.

Trigger reading all variables from Maxima that are shown in the Variables sidebar

Field Documentation

◆ m_closing

bool wxMaxima::m_closing = false
protected

Did we tell maxima to close?

If we didn't we respan an unexpectedly-closing maxima.

◆ m_gnuplotProbedCommand

wxString wxMaxima::m_gnuplotProbedCommand
protected

The gnuplot command whose terminal support we already probed.

Set when a terminal query completes. A Maxima restart re-sends gnuplot_command; if it resolves to the same gnuplot as before, its capabilities haven't changed and no new probe process is spawned - the cached UsePngCairo() answer is pushed to the new Maxima by ConfigChanged() anyway.

◆ m_scheduleUpdateToc

bool wxMaxima::m_scheduleUpdateToc = false
protected

True = schedule an update of the table of contents.

used by UpdateTableOfContents() and the idle task.

◆ m_server

std::unique_ptr<wxSocketServer, ServerDeleter> wxMaxima::m_server
protected

The server maxima connects to as client.

The destructor of the server causes crashes if there are still pending events. Instead we need to call destroy.


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