wxMaxima
wxMaxima.h
Go to the documentation of this file.
1 // -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2 // Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
3 // (C) 2013 Doug Ilijev <doug.ilijev@gmail.com>
4 // (C) 2014-2018 Gunter Königsmann <wxMaxima@physikbuch.de>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // SPDX-License-Identifier: GPL-2.0+
22 
31 #ifndef WXMAXIMA_H
32 #define WXMAXIMA_H
33 
34 #include "wxMaximaFrame.h"
35 #include "MathParser.h"
36 #include "MaximaIPC.h"
37 #include "Dirstructure.h"
38 #include <wx/socket.h>
39 #include <wx/config.h>
40 #include <wx/process.h>
41 #include <wx/regex.h>
42 #include <wx/dnd.h>
43 #include <wx/wfstream.h>
44 #include <wx/zstream.h>
45 #include <wx/txtstrm.h>
46 #include <wx/sckstrm.h>
47 #include <wx/buffer.h>
48 #include <wx/power.h>
49 #include <memory>
50 #ifdef __WXMSW__
51 #include <windows.h>
52 #endif
53 #define DOCUMENT_VERSION_MAJOR 1
54 
69 #define DOCUMENT_VERSION_MINOR 5
70 
72 #define MAXIMAPOLLMSECS 2000
73 
74 class Maxima; // The Maxima process interface
75 class MaximaEvent;
76 
77 /* The top-level window and the main application logic
78 
79  */
80 class wxMaxima : public wxMaximaFrame
81 {
82 public:
83 
84  wxMaxima(wxWindow *parent, int id, wxLocale *locale, const wxString title,
85  const wxString &filename = wxEmptyString,
86  const wxPoint pos = wxDefaultPosition, const wxSize size = wxDefaultSize);
87 
88  virtual ~wxMaxima();
89 
91  static void PipeToStdout(){m_pipeToStdout = true;}
92  static void ExitOnError(){m_exitOnError = true;}
93  static void EnableIPC(){ MaximaIPC::EnableIPC(); }
94  static void ExtraMaximaArgs(const wxString &args){m_extraMaximaArgs = args;}
95 
97  enum TimerIDs
98  {
105  };
106 
107 #ifdef wxHAS_POWER_EVENTS
108  void OnPowerEvent(wxPowerEvent &event);
109 #endif
110 
112  void OnTimerEvent(wxTimerEvent &event);
113 
116 
117  void ShowTip(bool force);
118 
119  void SetWXMdata(const wxString &data){m_initialWorkSheetContents = data;}
121  void EvalOnStartup(bool eval)
122  {
123  m_evalOnStartup = eval;
124  }
125 
127  void ExitAfterEval(bool exitaftereval)
128  {
129  m_exitAfterEval = exitaftereval;
130  if(exitaftereval)
131  {
132  m_logPane->SetBatchMode();
133  }
134  }
135 
136  void StripLispComments(wxString &s);
137 
139  void LaunchHelpBrowser(wxString uri);
140 
141  void SendMaxima(wxString s, bool addToHistory = false);
142 
144  bool OpenFile(const wxString &file, const wxString &command ={});
145 
148  { return m_fileSaved; }
149 
151  void LoadImage(wxString file)
152  { m_worksheet->OpenHCaret(file, GC_TYPE_IMAGE); }
153 
155  bool QueryVariableValue();
156 
159  {
160  public:
161  explicit VersionNumber(const wxString &version);
162  long Major() const {return m_major;}
163  long Minor() const {return m_minor;}
164  long Patchlevel() const {return m_patchlevel;}
165  friend bool operator<(const VersionNumber& v1, const VersionNumber& v2);
166  friend bool operator>(const VersionNumber& v1, const VersionNumber& v2);
167  private:
168  long m_major;
169  long m_minor;
170  long m_patchlevel;
171  };
172 
173 private:
174  MaximaIPC m_ipc{this};
176  wxString m_initialWorkSheetContents;
177  static bool m_pipeToStdout;
178  static bool m_exitOnError;
179  static wxString m_extraMaximaArgs;
180  wxLocale *m_locale;
182  wxArrayString m_varNamesToQuery;
183 
184  bool m_isLogTarget;
186  bool m_openInitialFileError;
188  wxString EscapeForLisp(wxString str);
190  long long m_maximaJiffies_old;
192  long long m_cpuTotalJiffies_old;
195  wxString m_configCommands;
197  static wxRegEx m_gnuplotErrorRegex;
199  bool AbortOnError();
201  wxString m_oldFindString;
203  int m_oldFindFlags;
205  bool m_hasEvaluatedCells;
207 // static wxRegEx m_outputPromptRegEx;
209  int m_outputCellsFromCurrentCommand;
211  int m_maxOutputCellsPerCommand;
218  int m_unsuccessfulConnectionAttempts;
220  wxString m_CWD;
222  bool m_evalOnStartup;
224  bool m_exitAfterEval;
226  bool m_ready;
227 
232  wxString GetUnmatchedParenthesisState(wxString text,int &index);
234  wxMemoryBuffer m_uncompletedChars;
235 
236 protected:
238  wxString ReadPotentiallyUnclosedTag(wxStringTokenizer &lines, wxString firstLine);
239 
241  static wxRegEx m_xmlOpeningTagName;
243  static wxRegEx m_xmlOpeningTag;
245  wxProcess *m_gnuplotProcess = NULL;
247  wxProcess *m_gnuplotTerminalQueryProcess = NULL;
251  void OnActivate(wxActivateEvent &event);
253  void OnMinimize(wxIconizeEvent &event);
255  void ConfigChanged();
257  void OnJumpToError(wxCommandEvent &event);
259  void OnSymbolAdd(wxCommandEvent &event);
261  void OnFollow(wxCommandEvent &event);
262 
264  void ShowMaximaHelp(wxString = {});
265 
268 
270  void ShowWxMaximaHelp();
271 
273  void ShowHelp(const wxString &keyword);
274 
275  void CheckForUpdates(bool reportUpToDate = false);
276 
277  void OnRecentDocument(wxCommandEvent &event);
278  void OnRecentPackage (wxCommandEvent &event);
279  void OnUnsavedDocument(wxCommandEvent &event);
280 
281  void OnChar(wxKeyEvent &event);
282  void OnKeyDown(wxKeyEvent &event);
283 
302  void OnIdle(wxIdleEvent &event);
311  bool InterpretDataFromMaxima(const wxString &newData);
312  bool m_dataFromMaximaIs;
313 
314  void MenuCommand(const wxString &cmd);
315  void FileMenu(wxCommandEvent &event);
316  void MaximaMenu(wxCommandEvent &event);
317  void MatrixMenu(wxCommandEvent &event);
318  void EquationsMenu(wxCommandEvent &event);
319  void CalculusMenu(wxCommandEvent &event);
320  void SimplifyMenu(wxCommandEvent &event);
321  void PlotMenu(wxCommandEvent &event);
322  void ListMenu(wxCommandEvent &event);
323  void DrawMenu(wxCommandEvent &event);
324  void NumericalMenu(wxCommandEvent &event);
325  void HelpMenu(wxCommandEvent &event);
326  void EditMenu(wxCommandEvent &event);
327  void ReplaceSuggestion(wxCommandEvent &event);
328  void Interrupt(wxCommandEvent &event);
329  void UpdateMenus();
331  void UpdateToolBar();
332  void UpdateSlider();
333 
336  void ShowPane(wxCommandEvent &event); //<! Makes a sidebar visible
337  void OnProcessEvent(wxProcessEvent &event); //
338  void OnGnuplotClose(wxProcessEvent &event); //
339  void OnGnuplotQueryTerminals(wxProcessEvent &event); //
340  void PopupMenu(wxCommandEvent &event); //
341  void StatsMenu(wxCommandEvent &event); //
342 
344  void ChangeCellStyle(wxCommandEvent &event);
345 
347  void OnFind(wxFindDialogEvent &event);
348 
350  void OnFindClose(wxFindDialogEvent &event);
351 
353  void OnReplace(wxFindDialogEvent &event);
354 
356  void OnReplaceAll(wxFindDialogEvent &event);
357 
359  void OnMaximaConnect();
360 
362  void MaximaEvent(::MaximaEvent &event);
363 
365  void ServerEvent(wxSocketEvent &event);
366 
373  void AddDrawParameter(wxString cmd, int dimensionsOfNewDrawCommand = 2);
374 
375  /* Append something to the console. Might be Text or XML maths.
376 
377  \return A pointer to the last line of Unicode text that was appended or
378  NULL, if there is no such line (for example if the appended object is
379  maths instead).
380  */
381  TextCell *ConsoleAppend(wxString s, CellType type, const wxString &userLabel = {});
382 
383  enum AppendOpt { NewLine = 1, BigSkip = 2, PromptToolTip = 4, DefaultOpt = NewLine|BigSkip };
384  void DoConsoleAppend(wxString s, CellType type, AppendOpt opts = AppendOpt::DefaultOpt,
385  const wxString &userLabel = {});
386 
391  TextCell *DoRawConsoleAppend(wxString s, CellType type, AppendOpt opts = {});
392 
397  void EditInputMenu(wxCommandEvent &event);
399  void VarReadEvent(wxCommandEvent &event);
401  void VarAddAllEvent(wxCommandEvent &event);
402  void EvaluateEvent(wxCommandEvent &event); //
403  void InsertMenu(wxCommandEvent &event); //
404  void PrintMenu(wxCommandEvent &event);
405 
406  void SliderEvent(wxScrollEvent &event);
407 
409  void NetworkDClick(wxCommandEvent &ev);
410 
412  void HistoryDClick(wxCommandEvent &event);
413 
415  void TableOfContentsSelection(wxListEvent &event);
416 
417  void OnInspectorEvent(wxCommandEvent &ev);
418 
419  void DumpProcessOutput();
420 
422  void TriggerEvaluation();
423 
424  void TryUpdateInspector();
425 
426  bool UpdateDrawPane();
427 
428  wxString ExtractFirstExpression(const wxString &entry);
429 
430  wxString GetDefaultEntry();
431 
433  bool StartServer();
442  bool StartMaxima(bool force = false);
443 
444  void OnClose(wxCloseEvent &event);
445  wxString GetCommand(bool params = true);
446  // (uses guessConfiguration)
447 
449  void ReadStdErr();
450 
461  void ReadFirstPrompt(wxString &data);
462 
469  bool ParseNextChunkFromMaxima(wxString &data);
470 
472  int FindTagEnd(const wxString &data, const wxString &tag);
473 
481  void ReadMiscText(const wxString &data);
482 
487  void ReadPrompt(wxString &data);
488 
494  void ReadStatusBar(wxString &data);
495 
504  void ReadMath(wxString &data);
505 
511  void ReadMaximaIPC(wxString &data){m_ipc.ReadInputData(data);}
512  void ReadLoadSymbols(wxString &data);
513 
515  void ReadSuppressedOutput(wxString &data);
516 
519  void ReadVariables(wxString &data);
520 
523  void ReadAddVariables(wxString &data);
524  void VariableActionUserDir(const wxString &value);
525  void VariableActionTempDir(const wxString &value);
526  void VariableActionDebugmode(const wxString &value);
527  void VariableActionAutoconfVersion(const wxString &value);
528  void VariableActionAutoconfHost(const wxString &value);
529  void VariableActionMaximaInfodir(const wxString &value);
530  void VariableActionMaximaHtmldir(const wxString &value);
531  void VariableActionGnuplotCommand(const wxString &value);
532  void VariableActionMaximaSharedir(const wxString &value);
533  void VariableActionLispName(const wxString &value);
534  void VariableActionLispVersion(const wxString &value);
535  void VariableActionWxLoadFileName(const wxString &value);
536  void VariableActionWxSubscripts(const wxString &value);
537  void VariableActionLmxChar(const wxString &value);
538  void VariableActionDisplay2D(const wxString &value);
539  void VariableActionAltDisplay2D(const wxString &value);
540  void VariableActionNumer(const wxString &value);
541  void VariableActionAlgebraic(const wxString &value);
542  void VariableActionShowtime(const wxString &value);
543  void VariableActionDomain(const wxString &value);
544  void VariableActionAutoplay(const wxString &value);
545  void VariableActionEngineeringFormat(const wxString &value);
546  void VariableActionStringdisp(const wxString &value);
547  void VariableActionOperators(const wxString &value);
548  wxString m_maximaVariable_wxSubscripts;
549  wxString m_maximaVariable_lmxchar;
550  wxString m_maximaVariable_display2d;
551  wxString m_maximaVariable_altdisplay2d;
552  wxString m_maximaVariable_engineeringFormat;
553  bool m_readMaximaVariables = false;
558  long long GetTotalCpuTime();
559 
565  long long GetMaximaCpuTime();
566 
571  double GetMaximaCPUPercentage();
572 
574  bool SaveNecessary();
575 
584  void SetupVariables();
585 
586  void KillMaxima(bool logMessage = true);
587 
594  void ResetTitle(bool saved, bool force = false);
595 
600  void BecomeLogTarget();
601 
602  void FirstOutput();
603 
606  bool OpenXML(const wxString &file, Worksheet *document);
607 
609  bool CheckWXMXVersion(const wxString &docversion);
610 
612  bool OpenMACFile(const wxString &file, Worksheet *document, bool clearDocument = true);
613 
615  bool OpenWXMFile(const wxString &file, Worksheet *document, bool clearDocument = true);
616 
618  bool OpenWXMXFile(const wxString &file, Worksheet *document, bool clearDocument = true);
619 
621  std::unique_ptr<GroupCell> CreateTreeFromXMLNode(wxXmlNode *xmlcells, const wxString &wxmxfilename = {});
622 
627  bool SaveFile(bool forceSave = false);
628 
630  bool SaveOnClose();
635  bool AutoSave();
636 
637  int SaveDocumentP();
638 
640  void SetCWD(wxString file);
641 
643  wxString GetCWD()
644  {
645  return m_CWD;
646  }
647 
648  std::unique_ptr<Maxima> m_client;
654  struct ServerDeleter {
655  void operator()(wxSocketServer* server) const {
656  server->Close();
657  wxLogMessage(_("Closing the socket maxima could connect to!"));
658  server->Destroy();
659  }
660 };
667  std::unique_ptr<wxSocketServer, ServerDeleter> m_server;
668 
669  wxProcess *m_process;
671  wxInputStream *m_maximaStdout;
673  wxInputStream *m_maximaStderr;
674  int m_port;
685  wxString m_currentOutput;
687  static wxString m_mathPrefix1;
689  static wxString m_mathPrefix2;
691  static wxString m_mathSuffix1;
693  static wxString m_mathSuffix2;
695  static wxString m_promptPrefix;
696 public:
698  const static wxString m_promptSuffix;
699 protected:
701  void GnuplotCommandName(wxString gnuplot);
703  static wxString m_variablesPrefix;
705  static wxString m_variablesSuffix;
707 // static wxString m_outputPromptPrefix;
709 // static wxString m_outputPromptSuffix;
711  static wxString m_statusbarPrefix;
713  static wxString m_statusbarSuffix;
715  static wxString m_addVariablesPrefix;
717  static wxString m_addVariablesSuffix;
719  static wxString m_symbolsPrefix;
721  static wxString m_symbolsSuffix;
723  static wxString m_suppressOutputPrefix;
725  static wxString m_suppressOutputSuffix;
727  static wxString m_firstPrompt;
729  static wxString m_emptywxxmlSymbols;
731  wxString m_lastPrompt;
732  wxString m_lastPath;
733  std::unique_ptr<wxPrintData> m_printData;
738  bool m_closing;
739  wxString m_openFile;
741  wxString m_maximaTempDir;
742  wxString m_maximaHtmlDir;
743  bool m_fileSaved;
744  wxString m_maximaArch;
745  wxString m_lispVersion;
746  wxString m_lispType;
747  static int m_exitCode;
752  wxFindReplaceData m_findData;
753  static wxRegEx m_funRegEx;
754  static wxRegEx m_varRegEx;
755  static wxRegEx m_blankStatementRegEx;
756  static wxRegEx m_sbclCompilationRegEx;
757  MathParser m_parser;
758  bool m_maximaBusy;
759 private:
761  typedef void (wxMaxima::*ParseFunction)(wxString &s);
762  WX_DECLARE_STRING_HASH_MAP(ParseFunction, ParseFunctionHash);
763  typedef void (wxMaxima::*VarReadFunction)(const wxString &value);
764  WX_DECLARE_STRING_HASH_MAP(VarReadFunction, VarReadFunctionHash);
766  static ParseFunctionHash m_knownXMLTags;
768  static VarReadFunctionHash m_variableReadActions;
769 
770 #if wxUSE_DRAG_AND_DROP
771 
772  friend class MyDropTarget;
773 
774 #endif
775  friend class MaximaIPC;
776 
787  wxTimer m_autoSaveTimer;
788 
789  /* A timer that delays redraws while maxima evaluates
790 
791  If we always start a redraw when maxima has nearly finished a command that slows
792  down evaluating many simple commands in a row.
793  */
794  wxTimer m_fastResponseTimer;
795 
797  void StartAutoSaveTimer();
798 
799 
800 
801 };
802 
803 #if wxUSE_DRAG_AND_DROP
804 
805 class MyDropTarget : public wxFileDropTarget
806 {
807 public:
808  explicit MyDropTarget(wxMaxima *wxmax)
809  { m_wxmax = wxmax; }
810 
811  bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &files);
812 
813 private:
814  wxMaxima *m_wxmax;
815 };
816 
817 #endif
818 
819 
820 // cppcheck-suppress noConstructor
821 class MyApp : public wxApp
822 {
823 public:
824  virtual bool OnInit();
825  virtual int OnRun();
826  virtual int OnExit();
827  wxLocale m_locale;
828 
842  void NewWindow(const wxString &file = {}, bool evalOnStartup = false, bool exitAfterEval = false, unsigned char *wxmData = NULL, size_t wxmLen = 0);
843 
844  static std::vector<wxMaxima *> m_topLevelWindows;
845  static void DelistTopLevelWindow(wxMaxima *);
846 
847  void OnFileMenu(wxCommandEvent &ev);
848 
849  virtual void MacNewFile();
850  void BecomeLogTarget();
851 
852  virtual void MacOpenFile(const wxString &file);
853 
854 private:
856  wxString m_configFileName;
857  Dirstructure m_dirstruct;
858  #if defined __WXOSX__
859  bool m_allWindowsInOneProcess = true;
860  #else
861  bool m_allWindowsInOneProcess = false;
862  #endif
863 };
864 
865 
866 
867 // cppcheck-suppress unknownMacro
868 DECLARE_APP(MyApp)
869 
870 #endif // WXMAXIMA_H
wxMaxima::m_server
std::unique_ptr< wxSocketServer, ServerDeleter > m_server
Definition: wxMaxima.h:667
MaximaEvent
Definition: Maxima.h:106
wxMaxima::m_commandIndex
int m_commandIndex
The Char the current command starts at in the current WorkingGroup.
Definition: wxMaxima.h:751
wxMaxima::m_xmlOpeningTagName
static wxRegEx m_xmlOpeningTagName
Finds the name of an opening tag.
Definition: wxMaxima.h:241
wxMaxima::FileMenu
void FileMenu(wxCommandEvent &event)
Processes "file menu" clicks.
Definition: wxMaxima.cpp:5440
wxMaxima::LoadImage
void LoadImage(wxString file)
Load an image from a file into the worksheet.
Definition: wxMaxima.h:151
wxMaxima::FindTagEnd
int FindTagEnd(const wxString &data, const wxString &tag)
Find the end of a tag in wxMaxima's output.
Definition: wxMaxima.cpp:2510
wxMaxima::OnFindClose
void OnFindClose(wxFindDialogEvent &event)
Is triggered when the "Close" button in the search dialog is pressed.
Definition: wxMaxima.cpp:6130
wxMaxima::StripLispComments
void StripLispComments(wxString &s)
Definition: wxMaxima.cpp:1544
wxMaxima::m_gnuplotProcess
wxProcess * m_gnuplotProcess
The gnuplot process info.
Definition: wxMaxima.h:245
TextCell
Definition: TextCell.h:36
wxMaxima::DoRawConsoleAppend
TextCell * DoRawConsoleAppend(wxString s, CellType type, AppendOpt opts={})
Definition: wxMaxima.cpp:1421
wxMaximaFrame::m_worksheet
Worksheet * m_worksheet
The worksheet itself.
Definition: wxMaximaFrame.h:804
wxMaxima::OnReplace
void OnReplace(wxFindDialogEvent &event)
Is triggered when the "Replace" button in the search dialog is pressed.
Definition: wxMaxima.cpp:6138
wxMaxima::m_maximaStdout
wxInputStream * m_maximaStdout
The stdout of the maxima process.
Definition: wxMaxima.h:671
wxMaxima::TableOfContentsSelection
void TableOfContentsSelection(wxListEvent &event)
Issued on double click on a table of contents item.
Definition: wxMaxima.cpp:10265
wxMaxima::StartMaxima
bool StartMaxima(bool force=false)
Definition: wxMaxima.cpp:1807
MyApp
Definition: wxMaxima.h:821
wxMaximaFrame::m_logPane
LogPane * m_logPane
The panel the log and debug messages will appear on.
Definition: wxMaximaFrame.h:802
wxMaxima::PrintMenu
void PrintMenu(wxCommandEvent &event)
Definition: wxMaxima.cpp:4602
wxMaxima::GetCWD
wxString GetCWD()
Get the current working directory file I/O from maxima is relative to.
Definition: wxMaxima.h:643
wxMaxima::QueryVariableValue
bool QueryVariableValue()
Query the value of a new maxima variable.
Definition: wxMaxima.cpp:3137
wxMaxima::KillMaxima
void KillMaxima(bool logMessage=true)
kills the maxima process
Definition: wxMaxima.cpp:2070
wxMaxima::PlotMenu
void PlotMenu(wxCommandEvent &event)
Processes "Plot menu" cloicks.
Definition: wxMaxima.cpp:8128
wxMaxima::HistoryDClick
void HistoryDClick(wxCommandEvent &event)
Issued on double click on a history item.
Definition: wxMaxima.cpp:10258
wxMaxima::SendMaxima
void SendMaxima(wxString s, bool addToHistory=false)
Definition: wxMaxima.cpp:1562
MaximaIPC
Definition: MaximaIPC.h:39
MaximaIPC::ReadInputData
void ReadInputData(wxString &data)
Definition: MaximaIPC.cpp:86
wxMaxima::ReadMath
void ReadMath(wxString &data)
Definition: wxMaxima.cpp:2547
wxMaxima::m_variablesPrefix
static wxString m_variablesPrefix
The marker for the start of a variables section.
Definition: wxMaxima.h:703
wxMaxima::OnTimerEvent
void OnTimerEvent(wxTimerEvent &event)
Is triggered when a timer this class is responsible for requires.
Definition: wxMaxima.cpp:5354
wxMaxima::m_maximaStderr
wxInputStream * m_maximaStderr
The stderr of the maxima process.
Definition: wxMaxima.h:673
MathParser.h
wxMaxima::EditMenu
void EditMenu(wxCommandEvent &event)
Processes "Edit menu" clicks.
Definition: wxMaxima.cpp:5676
wxMaxima::OnFollow
void OnFollow(wxCommandEvent &event)
Called when the "Scroll to currently evaluated" button is pressed.
Definition: wxMaxima.cpp:10279
wxMaxima::ListMenu
void ListMenu(wxCommandEvent &event)
Processes "list menu" clicks.
Definition: wxMaxima.cpp:7236
wxMaxima::ReadAddVariables
void ReadAddVariables(wxString &data)
Definition: wxMaxima.cpp:3101
wxMaxima::VarAddAllEvent
void VarAddAllEvent(wxCommandEvent &event)
Trigger adding all variables to the variables sidebar.
Definition: wxMaxima.cpp:9503
wxMaxima::m_firstPrompt
static wxString m_firstPrompt
The first prompt maxima will output.
Definition: wxMaxima.h:727
wxMaxima::ReadPotentiallyUnclosedTag
wxString ReadPotentiallyUnclosedTag(wxStringTokenizer &lines, wxString firstLine)
Reads a potentially unclosed XML tag and closes it.
Definition: wxMaxima.cpp:3502
MyApp::NewWindow
void NewWindow(const wxString &file={}, bool evalOnStartup=false, bool exitAfterEval=false, unsigned char *wxmData=NULL, size_t wxmLen=0)
Definition: main.cpp:424
wxMaxima::TriggerEvaluation
void TriggerEvaluation()
Try to evaluate the next command for maxima that is in the evaluation queue.
Definition: wxMaxima.cpp:9699
wxMaxima::GetMaximaCpuTime
long long GetMaximaCpuTime()
Definition: wxMaxima.cpp:5266
wxMaxima::m_promptPrefix
static wxString m_promptPrefix
The marker for the start of a input prompt.
Definition: wxMaxima.h:695
wxMaxima::VarReadEvent
void VarReadEvent(wxCommandEvent &event)
Trigger reading all variables from Maxima that are shown in the Variables sidebar.
Definition: wxMaxima.cpp:9513
wxMaxima::m_suppressOutputSuffix
static wxString m_suppressOutputSuffix
The marker that tells to stop to suppress any output from maxima.
Definition: wxMaxima.h:725
wxMaxima::m_maximaStdoutPollTimer
wxTimer m_maximaStdoutPollTimer
A timer that polls for output from the maxima process.
Definition: wxMaxima.h:115
wxMaxima::BecomeLogTarget
void BecomeLogTarget()
Definition: wxMaxima.cpp:2064
wxMaxima::m_xmlOpeningTag
static wxRegEx m_xmlOpeningTag
Looks if this opening tag is actually complete.
Definition: wxMaxima.h:243
wxMaxima::MaximaEvent
void MaximaEvent(::MaximaEvent &event)
Maxima sends or receives data, or disconnects.
Definition: wxMaxima.cpp:1658
wxMaxima::ResetTitle
void ResetTitle(bool saved, bool force=false)
Definition: wxMaxima.cpp:10130
wxMaxima::MaximaMenu
void MaximaMenu(wxCommandEvent &event)
Processes "maxima menu" clicks.
Definition: wxMaxima.cpp:6176
wxMaxima::EditInputMenu
void EditInputMenu(wxCommandEvent &event)
Definition: wxMaxima.cpp:9489
wxMaxima::ReadPrompt
void ReadPrompt(wxString &data)
Definition: wxMaxima.cpp:3175
wxMaxima::m_suppressOutputPrefix
static wxString m_suppressOutputPrefix
The marker that tells to start suppressing any output from maxima.
Definition: wxMaxima.h:723
wxMaxima::ShowPane
void ShowPane(wxCommandEvent &event)
Definition: wxMaxima.cpp:10217
wxMaxima::GetTotalCpuTime
long long GetTotalCpuTime()
Definition: wxMaxima.cpp:5225
wxMaxima::m_gnuplotcommand
wxString m_gnuplotcommand
Maxima's idea about gnuplot's location.
Definition: wxMaxima.h:749
wxMaxima::PipeToStdout
static void PipeToStdout()
Pipe maxima's output to stdout.
Definition: wxMaxima.h:91
wxMaxima::m_symbolsSuffix
static wxString m_symbolsSuffix
The marker for the end of a list of autocompletion templates.
Definition: wxMaxima.h:721
wxMaxima::EquationsMenu
void EquationsMenu(wxCommandEvent &event)
Processes "equations menu" clicks.
Definition: wxMaxima.cpp:6359
wxMaxima::TimerIDs
TimerIDs
An enum of individual IDs for all timers this class handles.
Definition: wxMaxima.h:97
wxMaxima::OpenWXMXFile
bool OpenWXMXFile(const wxString &file, Worksheet *document, bool clearDocument=true)
Opens a wxmx file.
Definition: wxMaxima.cpp:3544
wxMaxima::UpdateToolBar
void UpdateToolBar()
Enables and disables the Right toolbar buttons.
Definition: wxMaxima.cpp:4713
wxMaxima::m_currentOutputEnd
wxString m_currentOutputEnd
Definition: wxMaxima.h:683
wxMaxima::SimplifyMenu
void SimplifyMenu(wxCommandEvent &event)
Processes "Simplify menu" clicks.
Definition: wxMaxima.cpp:7696
wxMaxima::StartServer
bool StartServer()
starts the server
Definition: wxMaxima.cpp:1750
wxMaxima::OnClose
void OnClose(wxCloseEvent &event)
close wxMaxima window
Definition: wxMaxima.cpp:8748
wxMaxima::DocumentSaved
bool DocumentSaved()
Does this document need saving?
Definition: wxMaxima.h:147
wxMaxima::ReadMaximaIPC
void ReadMaximaIPC(wxString &data)
Definition: wxMaxima.h:511
wxMaxima::ReadVariables
void ReadVariables(wxString &data)
Definition: wxMaxima.cpp:2616
wxMaxima::DrawMenu
void DrawMenu(wxCommandEvent &event)
Processes "draw menu" clicks.
Definition: wxMaxima.cpp:7036
wxMaxima::ReadSuppressedOutput
void ReadSuppressedOutput(wxString &data)
Read (and discard) suppressed output.
Definition: wxMaxima.cpp:2585
wxMaxima::OnIdle
void OnIdle(wxIdleEvent &event)
Definition: wxMaxima.cpp:4337
wxMaxima::m_emptywxxmlSymbols
static wxString m_emptywxxmlSymbols
An empty wxxml symbols section.
Definition: wxMaxima.h:729
wxMaxima::ParseNextChunkFromMaxima
bool ParseNextChunkFromMaxima(wxString &data)
Definition: wxMaxima.cpp:2335
wxMaxima::ServerEvent
void ServerEvent(wxSocketEvent &event)
Server event: Maxima connects.
Definition: wxMaxima.cpp:1699
wxMaxima::OpenFile
bool OpenFile(const wxString &file, const wxString &command={})
Open a file.
Definition: wxMaxima.cpp:4854
wxMaxima::m_closing
bool m_closing
Definition: wxMaxima.h:738
wxMaxima::m_mathSuffix2
static wxString m_mathSuffix2
A marker for the end of maths.
Definition: wxMaxima.h:693
wxMaxima::m_gnuplotTerminalQueryProcess
wxProcess * m_gnuplotTerminalQueryProcess
Info about the gnuplot process we start for querying the terminals it supports.
Definition: wxMaxima.h:247
wxMaxima::m_promptSuffix
const static wxString m_promptSuffix
The marker for the end of a input prompt.
Definition: wxMaxima.h:698
wxMaxima::ServerDeleter
Definition: wxMaxima.h:654
wxMaxima::SetCWD
void SetCWD(wxString file)
Set the current working directory file I/O from maxima is relative to.
Definition: wxMaxima.cpp:3334
wxMaxima::AutoSave
bool AutoSave()
Definition: wxMaxima.cpp:5392
wxMaxima::Interrupt
void Interrupt(wxCommandEvent &event)
Definition: wxMaxima.cpp:1923
wxMaxima::ConfigChanged
void ConfigChanged()
Is called on start and whenever the configuration changes.
Definition: wxMaxima.cpp:128
wxMaxima::OnActivate
void OnActivate(wxActivateEvent &event)
Called when this window is activated or deactivated.
Definition: wxMaxima.cpp:10435
wxMaxima::AddDrawParameter
void AddDrawParameter(wxString cmd, int dimensionsOfNewDrawCommand=2)
Definition: wxMaxima.cpp:7006
wxMaxima::MatrixMenu
void MatrixMenu(wxCommandEvent &event)
Processes "algebra menu" clicks.
Definition: wxMaxima.cpp:6622
CellType
CellType
Definition: Cell.h:63
wxMaxima::m_isActive
bool m_isActive
Is this window active?
Definition: wxMaxima.h:249
wxMaxima::m_statusbarPrefix
static wxString m_statusbarPrefix
The marker for the start of a prompt.
Definition: wxMaxima.h:711
wxMaxima::ReplaceSuggestion
void ReplaceSuggestion(wxCommandEvent &event)
Processes clicks on suggestions.
Definition: wxMaxima.cpp:9866
wxMaxima::InterpretDataFromMaxima
bool InterpretDataFromMaxima(const wxString &newData)
Definition: wxMaxima.cpp:4264
wxMaxima::ShowHelp
void ShowHelp(const wxString &keyword)
Try to determine if help is needed for maxima or wxMaxima and show this help.
Definition: wxMaxima.cpp:4208
wxMaxima::ShowMaximaHelp
void ShowMaximaHelp(wxString={})
Show the help for Maxima.
Definition: wxMaxima.cpp:4216
wxMaxima::ShowWxMaximaHelp
void ShowWxMaximaHelp()
Show the help for wxMaxima.
Definition: wxMaxima.cpp:4118
wxMaxima::OnMinimize
void OnMinimize(wxIconizeEvent &event)
Called when this window is minimized.
Definition: wxMaxima.cpp:10442
wxMaxima::OnFind
void OnFind(wxFindDialogEvent &event)
Is triggered when the "Find" button in the search dialog is pressed.
Definition: wxMaxima.cpp:6122
wxMaximaFrame.h
wxMaxima::KEYBOARD_INACTIVITY_TIMER_ID
@ KEYBOARD_INACTIVITY_TIMER_ID
The keyboard was inactive long enough that we can attempt an auto-save.
Definition: wxMaxima.h:100
wxMaxima::OnReplaceAll
void OnReplaceAll(wxFindDialogEvent &event)
Is triggered when the "Replace All" button in the search dialog is pressed.
Definition: wxMaxima.cpp:6155
wxMaxima::ShowMaximaHelpWithoutAnchor
void ShowMaximaHelpWithoutAnchor()
Show the help for Maxima (without handling of anchors).
Definition: wxMaxima.cpp:4170
wxMaxima::SaveNecessary
bool SaveNecessary()
Does this file contain anything worth saving?
Definition: wxMaxima.cpp:9473
wxMaxima::SaveFile
bool SaveFile(bool forceSave=false)
Definition: wxMaxima.cpp:5010
wxMaxima::ReadStatusBar
void ReadStatusBar(wxString &data)
Definition: wxMaxima.cpp:2518
wxMaxima::m_statusbarSuffix
static wxString m_statusbarSuffix
The marker for the end of a variables section.
Definition: wxMaxima.h:713
wxMaxima::m_dispReadOut
bool m_dispReadOut
what is displayed in statusbar
Definition: wxMaxima.h:730
Worksheet::OpenHCaret
void OpenHCaret(const wxString &txt={})
Place the cursor into a new cell where the horizontal cursor is.
Definition: Worksheet.h:1323
wxMaxima::m_symbolsPrefix
static wxString m_symbolsPrefix
The marker for the start of a list of autocompletion templates.
Definition: wxMaxima.h:719
wxMaxima::m_variablesSuffix
static wxString m_variablesSuffix
The marker for the end of a variables section.
Definition: wxMaxima.h:705
wxMaxima::LaunchHelpBrowser
void LaunchHelpBrowser(wxString uri)
Launches the help browser on the uri passed as an argument.
Definition: wxMaxima.cpp:4091
Dirstructure
Definition: Dirstructure.h:57
wxMaxima::MenuCommand
void MenuCommand(const wxString &cmd)
Inserts command cmd into the worksheet.
Definition: wxMaxima.cpp:4589
wxMaxima::ConsoleAppend
TextCell * ConsoleAppend(wxString s, CellType type, const wxString &userLabel={})
append maxima output to console
Definition: wxMaxima.cpp:1293
MathParser
Definition: MathParser.h:50
wxMaxima::VersionNumber
A version number that can be compared using "<" and ">".
Definition: wxMaxima.h:158
wxMaxima::OnJumpToError
void OnJumpToError(wxCommandEvent &event)
Called when the "Scroll to last error" button is pressed.
wxMaxima::EvaluateEvent
void EvaluateEvent(wxCommandEvent &event)
Handle the evaluation event.
Definition: wxMaxima.cpp:9525
wxMaxima::CreateTreeFromXMLNode
std::unique_ptr< GroupCell > CreateTreeFromXMLNode(wxXmlNode *xmlcells, const wxString &wxmxfilename={})
Loads a wxmx description.
Definition: wxMaxima.cpp:3924
wxMaxima::m_mathSuffix1
static wxString m_mathSuffix1
A marker for the end of maths.
Definition: wxMaxima.h:691
wxMaximaFrame
Definition: wxMaximaFrame.h:59
wxMaxima
Definition: wxMaxima.h:80
Worksheet
Definition: Worksheet.h:86
wxMaxima::OpenXML
bool OpenXML(const wxString &file, Worksheet *document)
Definition: wxMaxima.cpp:3863
wxMaxima::HelpMenu
void HelpMenu(wxCommandEvent &event)
Processes "Help menu" clicks.
Definition: wxMaxima.cpp:8326
wxMaxima::GetMaximaCPUPercentage
double GetMaximaCPUPercentage()
Definition: wxMaxima.cpp:5323
wxMaxima::ShowTip
void ShowTip(bool force)
Definition: wxMaxima.cpp:4074
wxMaxima::m_mathPrefix1
static wxString m_mathPrefix1
A marker for the start of maths.
Definition: wxMaxima.h:687
wxMaxima::VariableActionMaximaSharedir
void VariableActionMaximaSharedir(const wxString &value)
Definition: wxMaxima.cpp:2858
wxMaxima::ExitAfterEval
void ExitAfterEval(bool exitaftereval)
Do we want to exit the program after evaluation?
Definition: wxMaxima.h:127
wxMaxima::SaveOnClose
bool SaveOnClose()
Try to save the file before closing it - or return false.
Definition: wxMaxima.cpp:8690
wxMaxima::ReadFirstPrompt
void ReadFirstPrompt(wxString &data)
Definition: wxMaxima.cpp:2267
wxMaxima::OpenWXMFile
bool OpenWXMFile(const wxString &file, Worksheet *document, bool clearDocument=true)
Opens a wxm file.
Definition: wxMaxima.cpp:3441
wxMaxima::CheckWXMXVersion
bool CheckWXMXVersion(const wxString &docversion)
Complains if the version string from the XML file indicates too low a maxima version.
Definition: wxMaxima.cpp:3840
wxMaxima::NetworkDClick
void NetworkDClick(wxCommandEvent &ev)
Issued on double click on the network status.
Definition: wxMaxima.cpp:10250
Dirstructure.h
wxMaxima::MAXIMA_STDOUT_POLL_ID
@ MAXIMA_STDOUT_POLL_ID
We look if we got new data from maxima's stdout.
Definition: wxMaxima.h:104
wxMaxima::UpdateMenus
void UpdateMenus()
Make the menu item, toolbars and panes visible that should be visible right now.
Definition: wxMaxima.cpp:4644
wxMaxima::m_addVariablesPrefix
static wxString m_addVariablesPrefix
The marker for the start of a "add variables" section.
Definition: wxMaxima.h:715
wxMaxima::ReadMiscText
void ReadMiscText(const wxString &data)
Definition: wxMaxima.cpp:2418
wxMaxima::UpdateSlider
void UpdateSlider()
Updates the slider to show the right frame.
Definition: wxMaxima.cpp:10185
wxMaxima::m_currentOutput
wxString m_currentOutput
All from maxima's current output we still haven't interpreted.
Definition: wxMaxima.h:685
wxMaxima::AUTO_SAVE_TIMER_ID
@ AUTO_SAVE_TIMER_ID
The time between two auto-saves has elapsed.
Definition: wxMaxima.h:102
wxMaxima::ReadStdErr
void ReadStdErr()
Polls the stderr and stdout of maxima for input.
Definition: wxMaxima.cpp:5127
wxMaxima::m_maximaTempDir
wxString m_maximaTempDir
The directory with maxima's temp files.
Definition: wxMaxima.h:741
wxMaxima::m_mathPrefix2
static wxString m_mathPrefix2
A marker for the start of maths.
Definition: wxMaxima.h:689
wxMaxima::ChangeCellStyle
void ChangeCellStyle(wxCommandEvent &event)
Is triggered when the textstyle drop-down box's value is changed.
Definition: wxMaxima.cpp:10450
wxMaxima::m_addVariablesSuffix
static wxString m_addVariablesSuffix
The marker for the end of a "add variables" section.
Definition: wxMaxima.h:717
Maxima
Definition: Maxima.h:51
wxMaxima::CalculusMenu
void CalculusMenu(wxCommandEvent &event)
event handling for menus
Definition: wxMaxima.cpp:7836
wxMaxima::GetCommand
wxString GetCommand(bool params=true)
returns the command to start maxima
Definition: wxMaxima.cpp:4036
wxMaxima::SetupVariables
void SetupVariables()
Definition: wxMaxima.cpp:3961
wxMaxima::OnMaximaConnect
void OnMaximaConnect()
Is called if maxima connects to wxMaxima.
Definition: wxMaxima.cpp:1713
wxMaxima::EvalOnStartup
void EvalOnStartup(bool eval)
Do we want to evaluate the document on startup?
Definition: wxMaxima.h:121
wxMaxima::OnSymbolAdd
void OnSymbolAdd(wxCommandEvent &event)
Sends a new char to the symbols sidebar.
Definition: wxMaxima.cpp:6168
wxMaxima::GnuplotCommandName
void GnuplotCommandName(wxString gnuplot)
Sets gnuplot's command name and tries to determine gnuplot's path.
Definition: wxMaxima.cpp:2757
wxMaxima::OpenMACFile
bool OpenMACFile(const wxString &file, Worksheet *document, bool clearDocument=true)
Opens a .mac file or a .out file from Xmaxima.
Definition: wxMaxima.cpp:3384
wxMaxima::NumericalMenu
void NumericalMenu(wxCommandEvent &event)
Processes "Numerical menu" clicks.
Definition: wxMaxima.cpp:8209