wxMaxima
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Types | 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)
 
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?
 
void StripLispComments (wxString &s)
 Remove empty statements. More...
 
void LaunchHelpBrowser (wxString uri)
 Launches the help browser on the uri passed as an argument.
 
void SendMaxima (wxString s, bool addToHistory=false)
 
bool OpenFile (const wxString &file, const wxString &command={})
 Open a file.
 
bool DocumentSaved ()
 Does this document need saving?
 
void LoadImage (const wxString &file)
 Load an image from a file into the worksheet.
 
bool QueryVariableValue ()
 Query the value of a new maxima variable.
 
void ShowToolBar (bool show)
 Shows or hides the toolbar. More...
 
void UpdateRecentDocuments ()
 Update the recent documents list. More...
 
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 More...
 
void ShowPane (int id, bool show=true)
 Show or hide a sidebar. More...
 
void TogglePaneVisibility (int 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 StatusMaximaBusy (StatusBar::MaximaStatus status)
 Set the status according to if maxima is calculating. More...
 
void UpdateStatusMaximaBusy ()
 
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".
 
void BecomeLogTarget ()
 Makes this window the debug log target of all windows from this maxima process. More...
 
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. More...
 
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.
 
StatusBar::MaximaStatus m_StatusMaximaBusy = StatusBar::wait_for_start
 
StatusBar::MaximaStatus m_StatusMaximaBusy_next = StatusBar::wait_for_start
 

Static Public Attributes

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

Protected Types

enum  AppendOpt { NewLine = 1 , BigSkip = 2 , PromptToolTip = 4 , DefaultOpt = NewLine|BigSkip }
 

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={})
 Invoke our standard wizard that generates maxima commands.
 
wxString ReadPotentiallyUnclosedTag (wxStringTokenizer &lines, wxString firstLine)
 Reads a potentially unclosed XML tag and closes it.
 
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,...) More...
 
void MenuCommand (const wxString &cmd)
 Inserts command cmd into the worksheet. More...
 
void FileMenu (wxCommandEvent &event)
 Processes "file menu" clicks.
 
void MaximaMenu (wxCommandEvent &event)
 Processes "maxima menu" clicks.
 
void MatrixMenu (wxCommandEvent &event)
 Processes "algebra menu" clicks.
 
void PropertiesMenu (wxCommandEvent &event)
 Processes "Variable/Function props menu" clicks.
 
void EquationsMenu (wxCommandEvent &event)
 Processes "equations menu" clicks.
 
void CalculusMenu (wxCommandEvent &event)
 event handling for menus
 
void SimplifyMenu (wxCommandEvent &event)
 Processes "Simplify menu" clicks.
 
void PlotMenu (wxCommandEvent &event)
 Processes "Plot menu" cloicks.
 
void ListMenu (wxCommandEvent &event)
 Processes "list menu" clicks.
 
void DrawMenu (wxCommandEvent &event)
 Processes "draw menu" clicks.
 
void NumericalMenu (wxCommandEvent &event)
 Processes "Numerical menu" clicks.
 
void HelpMenu (wxCommandEvent &event)
 Processes "Help menu" clicks.
 
void EditMenu (wxCommandEvent &event)
 Processes "Edit menu" clicks.
 
void ReplaceSuggestion (wxCommandEvent &event)
 Processes clicks on suggestions.
 
void Interrupt (wxCommandEvent &event)
 Interrupt button and hotkey presses 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. More...
 
void ShowPane (wxCommandEvent &event)
 Toggle the visibility of a pane. More...
 
void OnMaximaClose (wxProcessEvent &event)
 
void OnMaximaClose ()
 
void OnGnuplotClose (wxProcessEvent &event)
 
void OnGnuplotQueryTerminals (wxProcessEvent &event)
 
void PopupMenu (wxCommandEvent &event)
 
void StatsMenu (wxCommandEvent &event)
 
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 OnMaximaConnect ()
 Is called if maxima connects to wxMaxima.
 
void MaximaEvent (wxThreadEvent &event)
 Maxima sends or receives data, or disconnects. More...
 
void ServerEvent (wxSocketEvent &event)
 Server event: Maxima connects. More...
 
void AddDrawParameter (wxString cmd, int dimensionsOfNewDrawCommand=2)
 Add a parameter to a draw command. More...
 
TextCellConsoleAppend (wxString s, CellType type)
 append maxima output to console More...
 
void ConsoleAppend (wxXmlDocument xml, CellType type, const wxString &userLabel={})
 append maxima output to console More...
 
void DoConsoleAppend (wxString s, CellType type, AppendOpt opts=AppendOpt::DefaultOpt, const wxString &userLabel={})
 
TextCellDoRawConsoleAppend (wxString s, CellType type, AppendOpt opts={})
 Append one or more lines of ordinary unicode text to the console. More...
 
void EditInputMenu (wxCommandEvent &event)
 Spawn the "configure" menu. More...
 
void VarReadEvent (wxCommandEvent &event)
 Trigger reading all variables from Maxima that are shown in the Variables sidebar.
 
void VarAddAllEvent (wxCommandEvent &event)
 Trigger adding all variables to the variables sidebar.
 
void EvaluateEvent (wxCommandEvent &event)
 Handle the evaluation event.
 
void InsertMenu (wxCommandEvent &event)
 
void PrintMenu (wxCommandEvent &event)
 
void SliderEvent (wxScrollEvent &event)
 
void NetworkDClick (wxCommandEvent &ev)
 Issued on double click on the network status.
 
void MaximaDClick (wxCommandEvent &ev)
 Issued on double click on the Maxima status icon.
 
void StatusMsgDClick (wxCommandEvent &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 TriggerEvaluation ()
 Try to evaluate the next command for maxima that is in the evaluation queue. More...
 
void TryUpdateInspector ()
 
bool UpdateDrawPane ()
 
wxString ExtractFirstExpression (const wxString &entry)
 
wxString GetDefaultEntry ()
 
bool StartServer ()
 starts the server
 
bool StartMaxima (bool force=false)
 starts maxima (uses getCommand) or restarts it if needed More...
 
void OnClose (wxCloseEvent &event)
 close wxMaxima window
 
wxString GetCommand (bool params=true)
 returns the command to start maxima More...
 
void ReadStdErr ()
 Polls the stderr and stdout of maxima for input.
 
void ReadFirstPrompt (const wxString &data)
 Determines the process id of maxima from its initial output. More...
 
void ReadMiscText (const wxString &data)
 Reads text that isn't enclosed between xml tags. More...
 
void ReadPrompt (const wxString &data)
 Reads the input prompt from Maxima. More...
 
void ReadStatusBar (const wxXmlDocument &xmldoc)
 Reads the output of wxstatusbar() commands. More...
 
void ReadManualTopicNames (const wxXmlDocument &xmldoc)
 Read a manual topic name so we can jump to the right documentation page.
 
void ReadMath (const wxXmlDocument &xml)
 Reads the math cell's contents from Maxima. More...
 
void ReadMaximaIPC (const wxString &data)
 Reads autocompletion templates we get on definition of a function or variable. More...
 
void ReadLoadSymbols (const wxXmlDocument &data)
 
void ReadSuppressedOutput (const wxString &data)
 Read (and discard) suppressed output.
 
void ReadVariables (const wxXmlDocument &xmldoc)
 Reads the variable values maxima advertises to us.
 
void ReadAddVariables (const wxXmlDocument &xmldoc)
 Reads the "add variable to watch list" tag maxima can send us.
 
void VariableActionGentranlang (const wxString &value)
 Called if maxima tells us the value of the maxima variable gentranlang.
 
void VariableActionNumer (const wxString &value)
 Called if maxima tells us the value of the maxima variable numer.
 
void VariableActionDisplay2d_Unicode (const wxString &value)
 Called if maxima tells us the value of the maxima variable display2d_unicode.
 
void VariableActionHtmlHelp (const wxString &value)
 Called if maxima tells us the value of the maxima variable output_format_for_help.
 
void VariableActionOpSubst (const wxString &value)
 Called if maxima tells us the value of the maxima variable opsubst.
 
void VariableActionSinnpiflag (const wxString &value)
 Called if maxima tells us the value of the maxima variable sinnpiflag.
 
void VariableActionSinnpiflagUndefined ()
 Called if maxima tells us that the maxima variable sinnpiflag is undefined.
 
void VariableActionLogexpand (const wxString &value)
 Called if maxima tells us the value of the maxima variable logexpand.
 
void VariableActionUserDir (const wxString &value)
 Called if maxima tells us where the user files lie.
 
void VariableActionTempDir (const wxString &value)
 Called if maxima tells us where the temp files lie.
 
void VariableActionDebugmode (const wxString &value)
 Called if maxima tells us the value of the maxima variable debugmode.
 
void VariableActionAutoconfVersion (const wxString &value)
 Called if maxima tells us the maxima version as defined by autoconf.
 
void VariableActionAutoconfHost (const wxString &value)
 Called if maxima tells us the maxima build host as defined by autoconf.
 
void VariableActionMaximaInfodir (const wxString &value)
 Called if maxima tells us the maxima info dir.
 
void VariableActionMaximaHtmldir (const wxString &value)
 Called if maxima tells us the maxima html dir.
 
void VariableActionGnuplotCommand (const wxString &value)
 Called if maxima tells us the value of the maxima variable gnuplot
 
void VariableActionMaximaSharedir (const wxString &value)
 Called if maxima tells us the maxima share dir. More...
 
void VariableActionLispName (const wxString &value)
 Called if maxima tells us the lisp name.
 
void VariableActionLispVersion (const wxString &value)
 Called if maxima tells us the lisp version.
 
void VariableActionWxLoadFileName (const wxString &value)
 Called if maxima tells us the name of a package that was loaded.
 
void VariableActionWxSubscripts (const wxString &value)
 Called if maxima tells us the value of the maxima variable wxsubscripts
 
void VariableActionLmxChar (const wxString &value)
 Called if maxima tells us the value of the maxima variable lmxchar
 
void VariableActionDisplay2D (const wxString &value)
 Called if maxima tells us the value of the maxima variable display2d
 
void VariableActionAltDisplay2D (const wxString &value)
 Called if maxima tells us if it currently outputs XML.
 
void VariableActionAlgebraic (const wxString &value)
 Called if maxima tells us the value of the maxima variable algebraic
 
void VariableActionShowtime (const wxString &value)
 Called if maxima tells us the value of the maxima variable showtime
 
void VariableActionDomain (const wxString &value)
 Called if maxima tells us the value of the maxima variable domain
 
void VariableActionAutoplay (const wxString &value)
 Called if maxima tells us the value of the maxima variable wxanimate_autoplay
 
void VariableActionEngineeringFormat (const wxString &value)
 Called if maxima tells us the value of the maxima variable engineering_format_floats
 
void VariableActionStringdisp (const wxString &value)
 Called if maxima tells us the value of the maxima variable stringdisp
 
void VariableActionOperators (const wxString &value)
 Called if maxima sends us the list of known operators.
 
long long GetTotalCpuTime ()
 How much CPU time has been used by the system until now? Used by GetMaximaCPUPercentage. More...
 
long long GetMaximaCpuTime ()
 How much CPU time has maxima used till now? Used by GetMaximaCPUPercentage. More...
 
double GetMaximaCPUPercentage ()
 How much CPU horsepower is maxima using currently? More...
 
bool SaveNecessary ()
 Does this file contain anything worth saving?
 
void SetupVariables ()
 Setup maxima's variables. More...
 
void KillMaxima (bool logMessage=true)
 kills the maxima process
 
void ResetTitle (bool saved, bool force=false)
 Update the title. More...
 
void FirstOutput ()
 
bool OpenXML (const wxString &file, Worksheet *document)
 Opens a content.xml file that has been extracted from a broken .wxmx file.
 
bool CheckWXMXVersion (const wxString &docversion)
 Complains if the version string from the XML file indicates too low a maxima version.
 
bool OpenMACFile (const wxString &file, Worksheet *document, bool clearDocument=true)
 Opens a .mac file or a .out file from Xmaxima.
 
bool OpenWXMFile (const wxString &file, Worksheet *document, bool clearDocument=true)
 Opens a wxm file.
 
bool OpenWXMXFile (const wxString &file, Worksheet *document, bool clearDocument=true)
 Opens a wxmx file.
 
std::unique_ptr< GroupCellCreateTreeFromXMLNode (wxXmlNode *xmlcells, const wxString &wxmxfilename={})
 Loads a wxmx description.
 
bool SaveFile (bool forceSave=false)
 Saves the current file. More...
 
bool SaveOnClose ()
 Try to save the file before closing it - or return false.
 
bool AutoSave ()
 Save the project in a temp file. More...
 
int SaveDocumentP ()
 Tries or offers to save the document. More...
 
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 OnDemoFileMenu (wxCommandEvent &ev)
 Is called when a demo file menu is clicked.
 
void OnUpdateTOCEvent (wxCommandEvent &event)
 Is called when something requests an update of the table of contents.
 
void OnSize (wxSizeEvent &event)
 
void OnMove (wxMoveEvent &event)
 
void OnMaximize (wxCommandEvent &event)
 
void GnuplotCommandName (wxString gnuplot)
 Sets gnuplot's command name and tries to determine gnuplot's path.
 
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. More...
 
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.
 
bool m_isActive = true
 Is this window active?
 
bool m_dataFromMaximaIs = false
 
wxString m_maximaVariable_wxSubscripts
 
wxString m_maximaVariable_lmxchar
 
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. More...
 
wxProcess * m_maximaProcess = NULL
 
wxInputStream * m_maximaStdout = NULL
 The stdout of the maxima process.
 
wxInputStream * m_maximaStderr = NULL
 The stderr of the maxima process.
 
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. More...
 
bool m_dispReadOut = false
 what is displayed in statusbar
 
wxWindowIDRef m_gnuplot_process_id
 
wxWindowIDRef m_maxima_process_id
 
wxString m_lastPrompt
 
wxString m_lastPath
 
std::unique_ptr< wxPrintData > m_printData
 
bool m_closing = false
 Did we tell maxima to close? More...
 
wxString m_maximaTempDir
 The directory with maxima's temp files.
 
wxString m_maximaHtmlDir
 
bool m_fileSaved = true
 
wxString m_maximaArch
 
wxString m_lispVersion
 
wxString m_lispType
 
wxString m_gnuplotcommand
 Maxima's idea about gnuplot's location.
 
long m_commandIndex = -1
 The Char the current command starts at in the current WorkingGroup.
 
FindReplacePane::FindReplaceData m_findData
 
MathParser m_parser
 
bool m_maximaBusy = true
 
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.
 
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?
 
bool m_newStatusText
 Do we have new text to output in the Status Bar?
 
wxString m_rightStatusText
 The text for the Right half of the Status Bar.
 
wxString m_leftStatusText
 The text for the Left half of the Status Bar.
 
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?
 
std::unique_ptr< wxAuiManager > m_manager
 The manager for dynamic screen layouts.
 
Worksheet *const m_worksheet = NULL
 The worksheet itself. More...
 
History *const m_history = NULL
 The history pane.
 
XmlInspectorm_xmlInspector = NULL
 A XmlInspector-like xml monitor.
 
bool m_forceStatusbarUpdate = false
 true=force an update of the status bar at the next call of StatusMaximaBusy()
 
LogPanem_logPane = NULL
 The panel the log and debug messages will appear on.
 
RecentDocuments m_recentDocuments
 
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
 

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.

Constructor & Destructor Documentation

◆ wxMaxima()

wxMaxima::wxMaxima ( wxWindow *  parent,
int  id,
const wxString &  title,
const wxString &  filename = wxEmptyString,
const wxString &  initialWorksheetContents = wxEmptyString,
const wxPoint  pos = wxDefaultPosition,
const wxSize  size = wxDefaultSize 
)

wxm data the worksheet is populated from

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..

◆ AutoSave()

bool wxMaxima::AutoSave ( )
protected

Save the project in a temp file.

Returns false if a save was necessary, but not possible.

◆ BecomeLogTarget()

void wxMaximaFrame::BecomeLogTarget ( )
inherited

Makes this window the debug log target of all windows from this maxima process.

Only necessary on the mac where the same process creates loads of windows.

◆ ConsoleAppend() [1/2]

TextCell * wxMaxima::ConsoleAppend ( wxString  s,
CellType  type 
)
protected

append maxima output to console

ConsoleAppend adds a new line s of type to the console window.

It will call DoConsoleAppend if s is in xml and DoRawCosoleAppend if s is not in xml.

◆ ConsoleAppend() [2/2]

void wxMaxima::ConsoleAppend ( wxXmlDocument  xml,
CellType  type,
const wxString &  userLabel = {} 
)
protected

append maxima output to console


Appending stuff to output

◆ DockAllSidebars()

void wxMaximaFrame::DockAllSidebars ( wxCommandEvent &  ev)
protectedinherited

An instant single-window mode.

A last resort if https://trac.wxwidgets.org/ticket/18815 hinders one from re-docking windows.

◆ DoRawConsoleAppend()

TextCell * wxMaxima::DoRawConsoleAppend ( wxString  s,
CellType  type,
AppendOpt  opts = {} 
)
protected

Append one or more lines of ordinary unicode text to the console.

Returns
A pointer to the last line that was appended or NULL, if there is no such line

◆ EditInputMenu()

void wxMaxima::EditInputMenu ( wxCommandEvent &  event)
protected

Spawn the "configure" menu.

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

◆ EnableIPC()

static void wxMaxima::EnableIPC ( )
inlinestatic

Allow maxima to click buttons in wxMaxima.

Disabled by default for security reasons

◆ 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.

◆ 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

◆ MaximaEvent()

void wxMaxima::MaximaEvent ( wxThreadEvent &  event)
protected

Maxima sends or receives data, or disconnects.


Socket stuff

◆ 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.

If the queue is empty (which means that the computer has caught up with the incoming events) this function is called once.

Moving the screen update to this function makes sure that we don't do many subsequent updates slowing down the computer any further if there are still a handful of key presses to process lowering the average response times of the program.

The worksheet is refreshed by a timer task in case the computer is too busy to execute the idle task at all.


Idle event

◆ PrintMenu()

void wxMaxima::PrintMenu ( wxCommandEvent &  event)
protected

Menu and button events

◆ ReadFirstPrompt()

void wxMaxima::ReadFirstPrompt ( const wxString &  data)
protected

Determines the process id of maxima from its initial output.

This function does several things:

  • it sets m_pid to the process id of maxima
  • it discards all data until this point
  • and it prepares the worksheet for editing.
Parameters
dataThe string ReadFirstPrompt() does read its data from. After leaving this function data is empty again.

Dealing with stuff read from the socket

◆ ReadMath()

void wxMaxima::ReadMath ( const wxXmlDocument &  xml)
protected

Reads the math cell's contents from Maxima.

Math cells are enclosed between the tags <mth> and </mth>. This function removes the from data after appending them to the console.

After processing the status bar marker is removed from data.

◆ ReadMaximaIPC()

void wxMaxima::ReadMaximaIPC ( const wxString &  data)
inlineprotected

Reads autocompletion templates we get on definition of a function or variable.

After processing the templates they are removed from data.

◆ ReadMiscText()

void wxMaxima::ReadMiscText ( const wxString &  data)
protected

Reads text that isn't enclosed between xml tags.

Some commands provide status messages before the math output or the command has finished. This function makes wxMaxima output them directly as they arrive.

After processing the lines not enclosed in xml tags they are removed from data.

◆ ReadPrompt()

void wxMaxima::ReadPrompt ( const wxString &  data)
protected

Reads the input prompt from Maxima.

After processing the input prompt it is removed from data.

◆ ReadStatusBar()

void wxMaxima::ReadStatusBar ( const wxXmlDocument &  xmldoc)
protected

Reads the output of wxstatusbar() commands.

wxstatusbar allows the user to give and update visual feedback from long-running commands and makes sure this feedback is deleted once the command is finished.

◆ 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

◆ SaveFile()

bool wxMaxima::SaveFile ( bool  forceSave = false)
protected

Saves the current file.

Parameters
forceSavetrue means: Always ask for a file name before saving.
Returns
true, if the file was saved - or didn't need to

◆ SendMaxima()

void wxMaxima::SendMaxima ( wxString  s,
bool  addToHistory = false 
)

Check for function/variable definitions

Create a template from the input

◆ ServerEvent()

void wxMaxima::ServerEvent ( wxSocketEvent &  event)
protected

Server event: Maxima connects.

ServerEvent is triggered when maxima connects to the socket server.

◆ SetupVariables()

void wxMaxima::SetupVariables ( )
protected

Setup maxima's variables.

This method is called once when maxima starts. It loads wxmathml.lisp and sets some option variables.

Todo:
Set pngcairo to be the default terminal as soon as the mac platform supports it.

◆ 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

◆ StartMaxima()

bool wxMaxima::StartMaxima ( bool  force = false)
protected

starts maxima (uses getCommand) or restarts it if needed

Normally a restart is only needed if

  • maxima isn't currently in the process of starting up or
  • maxima is running and has never evaluated any program so a restart won't change anything
    Parameters
    forcetrue means to restart maxima unconditionally.

Maxima process stuff

◆ 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.

◆ TriggerEvaluation()

void wxMaxima::TriggerEvaluation ( )
protected

Try to evaluate the next command for maxima that is in the evaluation queue.

Tries to evaluate next group cell in queue.

◆ 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

◆ VariableActionMaximaSharedir()

void wxMaxima::VariableActionMaximaSharedir ( const wxString &  value)
protected

Called if maxima tells us the maxima share dir.

READ FUNCTIONS FOR AUTOCOMPLETION

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_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.

◆ m_worksheet

Worksheet* const wxMaximaFrame::m_worksheet = NULL
protectedinherited

The worksheet itself.

The worksheet


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