wxMaxima
Loading...
Searching...
No Matches
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 "BuildConfig.h"
35#include <vector>
36#include "wxMaximaFrame.h"
37#include "WXMXformat.h"
38#include "Configuration.h"
39#include "MathParser.h"
40#include "MaximaIPC.h"
41#include "MaximaCommandMenus.h"
44#include "MaximaEvaluator.h"
45#include "MaximaFileIO.h"
48#include "Dirstructure.h"
49#include <wx/socket.h>
50#include <wx/config.h>
51#include <wx/process.h>
52#include <wx/regex.h>
53#include <wx/dnd.h>
54#include <wx/txtstrm.h>
55#include <wx/sckstrm.h>
56#include <wx/buffer.h>
57#include <wx/power.h>
58#ifdef USE_QA
59#include <wx/debugrpt.h>
60#endif
61#include <memory>
62#ifdef __WXMSW__
63#include <windows.h>
64#endif
65#include <unordered_map>
66
68#define MAXIMAPOLLMSECS 2000
69
70class Maxima; // The Maxima process interface
71
72/* The top-level window and the main application logic
73
74 */
75class wxMaxima : public wxMaximaFrame
76{
77public:
78 wxMaxima(wxWindow *parent, int id, const wxString &title,
79 const wxString &filename = wxEmptyString,
80 const wxString &initialWorksheetContents = wxEmptyString,
81 const wxPoint pos = wxDefaultPosition, const wxSize size = wxDefaultSize);
82
83 ~wxMaxima() override;
84 wxString EscapeFilenameForShell(wxString name);
86 static void ExitOnError(){m_exitOnError = true;}
88 static bool GetExitOnError(){return m_exitOnError;}
99 bool ExitOnErrorArmed() const { return m_exitOnError && m_exitOnErrorArmed; }
100
101#ifdef __WXMSW__
110 static void RepairFileAssociations();
111#endif
116 static void EnableIPC(){ MaximaIPC::EnableIPC(); }
118 static bool GetEnableIPC(){ return MaximaIPC::GetEnableIPC(); }
120 static void ExtraMaximaArgs(const wxString &args){m_extraMaximaArgs = args;}
122 static wxString ExtraMaximaArgs(){return m_extraMaximaArgs;}
123
126 {
135 };
136
137#ifdef wxHAS_POWER_EVENTS
138 void OnPowerEvent(wxPowerEvent &event);
139#endif
140
142 void OnTimerEvent(wxTimerEvent &event);
143
146
160
161 void ShowTip(bool force);
163 void EvalOnStartup(bool eval)
164 {
165 m_evalOnStartup = eval;
166 }
167
169 void ExitAfterEval(bool exitaftereval);
179 bool IsInteractive() const { return !m_exitAfterEval; }
180
181 void StripLispComments(wxString &s);
182
184 void LaunchHelpBrowser(const wxString& uri);
185
186
189 { return m_fileSaved; }
190
192 void LoadImage(const wxString &file)
193 { GetWorksheet()->OpenHCaret(file, GC_TYPE_IMAGE); }
194
197 {
198 public:
199 explicit VersionNumber(const wxString &version);
200 long Major() const {return m_major;}
201 long Minor() const {return m_minor;}
202 long Patchlevel() const {return m_patchlevel;}
203 auto operator<=>(const VersionNumber&) const = default;
204 private:
205 long m_major = -1;
206 long m_minor = -1;
207 long m_patchlevel = -1;
208 };
209
211 static void Set_Maxima_Commandline_Filename(const wxString &filename)
212 {maxima_command_line_filename = filename;}
214 static const wxString Get_Maxima_Commandline_Filename() {return maxima_command_line_filename;}
215
226 enum ExitCode : int {
241 };
242
243 static int GetExitCode(){return m_exitCode;}
244
245private:
247 static wxString maxima_command_line_filename;
249 bool m_maximaAuthenticated = false;
251 bool m_discardAllData = false;
253 wxString m_maximaAuthString;
255 MaximaIPC m_ipc{this};
258 static bool m_exitOnError;
262 bool m_exitOnErrorArmed = true;
264 static wxString m_extraMaximaArgs;
266 std::vector<wxString> m_varNamesToQuery;
267
269 bool m_openInitialFileError = false;
271 wxString EscapeForLisp(wxString str);
273 long long m_maximaJiffies_old = 0;
275 long long m_cpuTotalJiffies_old = 0;
278 wxString m_configCommands;
280 static wxRegEx m_gnuplotErrorRegex;
282 wxString m_oldFindString;
284 int m_oldFindFlags = 0;
286 bool m_hasEvaluatedCells = false;
288 long m_outputCellsFromCurrentCommand = 0;
290 long m_maxOutputCellsPerCommand = 0;
297 int m_unsuccessfulConnectionAttempts = 11;
299 wxString m_CWD;
301 bool m_evalOnStartup = false;
303 bool m_exitAfterEval = false;
305 bool m_ready = false;
306
311 wxString GetUnmatchedParenthesisState(wxString text, std::size_t &index);
313 wxMemoryBuffer m_uncompletedChars;
314
315protected:
317 void CommandWiz(const wxString &title,
318 const wxString &description, const wxString &description_tooltip,
319 const wxString &commandRule,
320 const wxString& label1, const wxString& defaultval1, const wxString& tooltip1 = {},
321 const wxString& label2 = {}, const wxString& defaultval2 = {}, const wxString& tooltip2 = {},
322 const wxString& label3 = {}, const wxString& defaultval3 = {}, const wxString& tooltip3 = {},
323 const wxString& label4 = {}, const wxString& defaultval4 = {}, const wxString& tooltip4 = {},
324 const wxString& label5 = {}, const wxString& defaultval5 = {}, const wxString& tooltip5 = {},
325 const wxString& label6 = {}, const wxString& defaultval6 = {}, const wxString& tooltip6 = {},
326 const wxString& label7 = {}, const wxString& defaultval7 = {}, const wxString& tooltip7 = {},
327 const wxString& label8 = {}, const wxString& defaultval8 = {}, const wxString& tooltip8 = {},
328 const wxString& label9 = {}, const wxString& defaultval9 = {}, const wxString& tooltip9 = {},
329 const wxString& label10 = {}, const wxString& defaultval10 = {}, const wxString& tooltip10 = {}
330 );
332 static wxRegEx m_xmlOpeningTagName;
334 static wxRegEx m_xmlOpeningTag;
336 wxProcess *m_gnuplotProcess = nullptr;
338 wxProcess *m_gnuplotTerminalQueryProcess = nullptr;
350 wxProcess *m_gnuplotPopoutCheckProcess = nullptr;
364 bool m_isActive = true;
366 void OnFocus(wxFocusEvent &event);
368 void OnActivate(wxActivateEvent &event);
369
371 void PassKeyboardFocus();
373 void OnMinimize(wxIconizeEvent &event);
375 void ConfigChanged();
377 void OnJumpToError(wxCommandEvent &event);
379 void OnSymbolAdd(wxCommandEvent &event);
381 void OnFollow(wxCommandEvent &event);
382 void OnWizardAbort(wxCommandEvent &event);
383 void OnWizardOK(wxCommandEvent &event);
384 void OnWizardInsert(wxCommandEvent &event);
385 void OnWizardHelpButton(wxCommandEvent &event);
386
388 void ShowMaximaHelp(wxString = {});
389
392
399 void ShowWxMaximaHelp(const wxString &anchor = wxEmptyString);
400
402 void ShowHelp(const wxString &keyword);
403
404 void CheckForUpdates(bool reportUpToDate = false);
405
406 void OnRecentDocument(wxCommandEvent &event);
407 void OnRecentPackage (wxCommandEvent &event);
408 void OnUnsavedDocument(wxCommandEvent &event);
409
410 void OnChar(wxKeyEvent &event);
411 void OnKeyDown(wxKeyEvent &event);
412
439 void OnIdle(wxIdleEvent &event);
440 bool m_dataFromMaximaIs = false;
441
442 void MenuCommand(const wxString &cmd);
443
450 void ExportWorksheetToHtml(const wxString &filename, const wxString &flavor,
451 bool embedWxmx);
452
461 void ExportWorksheetToTex(const wxString &filename,
462 const wxString &documentclass,
463 const wxString &documentclassOptions,
464 bool embedWorksheet);
465#ifdef __WXMSW__
467 void RegisterWxmxDiffTool();
468#endif
469 void ReplaceSuggestion(wxCommandEvent &event);
471 void UpdateMenus();
472 void UpdateToolBar();
473 void UpdateSlider();
477 void ShowPane(wxCommandEvent &event); //<! Makes a sidebar visible
478
480 void ChangeCellStyle(wxCommandEvent &event);
482 void OnTextFormat(wxCommandEvent &event);
483
485 void OnFind(wxFindDialogEvent &event);
486
488 void OnReplace(wxFindDialogEvent &event);
489
491 void OnReplaceAll(wxFindDialogEvent &event);
492
499 void AddDrawParameter(wxString cmd, int dimensionsOfNewDrawCommand = 2);
500
501 // The console output appenders (ConsoleAppend / DoConsoleAppend /
502 // DoRawConsoleAppend) and their AppendOpt options now live in
503 // MaximaOutputAppender (m_outputAppender).
504
510 void VarReadEvent(wxCommandEvent &event);
512 void VarAddAllEvent(wxCommandEvent &event);
513
514 void SliderEvent(wxScrollEvent &event);
515
517 void NetworkDClick(wxMouseEvent &ev);
519 void MaximaDClick(wxMouseEvent &ev);
521 void StatusMsgDClick(wxMouseEvent &ev);
522
523#ifdef WXM_USE_AI_TOOLS
526 void AiStatusClick(wxMouseEvent &ev);
529 void AiStatusDClick(wxMouseEvent &ev);
532 void AiStatusRightClick(wxMouseEvent &ev);
533#endif
534
536 void HistoryDClick(wxCommandEvent &event);
537
539 void TableOfContentsSelection(wxListEvent &event);
540
541 void OnInspectorEvent(wxCommandEvent &ev);
542
543 void DumpProcessOutput();
544
545
546 void TryUpdateInspector();
547
548 bool UpdateDrawPane();
549
550 wxString GetDefaultEntry();
551
552 void OnClose(wxCloseEvent &event);
553 wxString GetCommand(bool params = true);
555 wxString MaximaExecutable() const;
557 wxString MaximaCommandArguments(bool params = true) const;
560 // (uses guessConfiguration)
561
562 void ReadMaximaIPC(const wxString &data){m_ipc.ReadInputData(data);}
563
564 wxString m_maximaVariable_display2d;
565 wxString m_maximaVariable_altdisplay2d;
566 wxString m_maximaVariable_engineeringFormat;
567 bool m_readMaximaVariables = false;
568 bool m_updateAutocompletion = true;
573 long long GetTotalCpuTime();
574
580 long long GetMaximaCpuTime();
581
586 double GetMaximaCPUPercentage();
587
589 bool SaveNecessary();
590
591
599 void ResetTitle(bool saved, bool force = false);
600
602 std::unique_ptr<GroupCell> CreateTreeFromXMLNode(wxXmlNode *xmlcells, const wxString &wxmxfilename = {});
603
605 bool SaveOnClose();
606
614 int SaveDocumentP();
615
617 void SetCWD(wxString file);
618
620 wxString GetCWD()
621 {
622 return m_CWD;
623 }
624
625 std::unique_ptr<Maxima> m_client;
632 std::unique_ptr<MaximaInterruptChannel> m_interruptChannel;
639 void operator()(wxSocketServer* server) const {
640 server->Destroy(); // Destroy() calls Close() automatically.
641 }
642 };
649 std::unique_ptr<wxSocketServer, ServerDeleter> m_server;
650
651 wxProcess *m_maximaProcess = nullptr;
653 wxInputStream *m_maximaStdout = nullptr;
655 wxInputStream *m_maximaStderr = nullptr;
659 wxOutputStream *m_maximaStdin = nullptr;
663 bool m_inLDB = false;
665 int m_port = -1;
667 static wxString m_mathPrefix1;
669 static wxString m_mathPrefix2;
671 static wxString m_promptPrefix;
672public:
674 const static wxString m_promptSuffix;
675protected:
681 void QuestionAnswered(){if(GetWorksheet()) GetWorksheet()->QuestionAnswered();}
684 void OnNewDemoFiles(wxCommandEvent &event);
686 void OnUpdateTOCEvent(wxCommandEvent &event);
687
689 static wxString m_firstPrompt;
690 bool m_dispReadOut = false;
691 wxWindowIDRef m_gnuplot_process_id;
692 wxWindowIDRef m_maxima_process_id;
693 wxString m_lastPrompt;
694 wxString m_firstPromptBuffer;
695 wxString m_lastPath;
696 std::unique_ptr<wxPrintData> m_printData;
701 bool m_closing = false;
704 wxString m_maximaHtmlDir;
705 bool m_fileSaved = true;
706 static int m_exitCode;
709#ifdef __WINDOWS__
710 // For Windows, store "gnuplot.exe", even if wgnuplot.exe is preferred.
711 // We query the terminals using: gnuplot -e "print GPVAL_TERMINALS"
712 // and that does only work with gnuplot, not wgnuplot.
714 wxString m_gnuplotcommand_commandline;
715#endif
716 long m_commandIndex = -1;
718 static wxRegEx m_funRegEx;
719 static wxRegEx m_varRegEx;
720 static wxRegEx m_blankStatementRegEx;
721 static wxRegEx m_sbclCompilationRegEx;
722 MathParser m_parser;
723 bool m_maximaBusy = true;
724 bool m_maximaError = false;
725private:
726 wxString m_fileToOpen;
727 bool m_fourierLoaded = false;
728
729#if wxUSE_DRAG_AND_DROP
730
731 friend class MyDropTarget;
732
733#endif
734 friend class MaximaIPC;
737 friend class MaximaCommandMenus;
749 friend class MaximaEvaluator;
753 friend class MaximaFileIO;
758
769 wxTimer m_autoSaveTimer;
770
771 /* A timer that delays redraws while maxima evaluates
772
773 If we always start a redraw when maxima has nearly finished a command that slows
774 down evaluating many simple commands in a row.
775 */
776 wxTimer m_fastResponseTimer;
777
779 void StartAutoSaveTimer();
783 MaximaCommandMenus m_menuCommands;
788 MaximaResponseReader m_responseReader;
792 MaximaProcessManager m_processManager;
796 MaximaEvaluator m_evaluator;
800 MaximaFileIO m_fileIO;
804 MaximaOutputAppender m_outputAppender;
805};
806
828 bool logImmediately = true);
829
830#if wxUSE_DRAG_AND_DROP
831
832// cppcheck-suppress noConstructor
833class MyApp : public wxApp
834{
835public:
836 bool OnInit() override;
837 int OnRun() override;
838 int OnExit() override;
839 // Both guards are needed, and in this order: the definition in main.cpp
840 // carries exactly the same pair, and GenerateDebugReport() -- the QA-only
841 // method this one calls -- is already declared under both further down.
842 // Declaring an override that no translation unit defines does not merely
843 // waste a line: it is emitted into MyApp's vtable, so the link fails with
844 // "undefined reference to MyApp::OnFatalException()" pointing at
845 // _ZTV5MyApp rather than at any call site. That is what a
846 // -DWXM_DISABLE_QA=YES build hit.
847 // The macro is USE_QA, not WXM_USE_QA: WXM_USE_QA is the *CMake option*,
848 // and src/BuildConfig.h.cin turns it into #cmakedefine USE_QA. Guarding on
849 // the option name instead compiles to "never", which removes the
850 // declaration from the default build too, where main.cpp still defines the
851 // member.
852#ifdef USE_QA
853#if wxUSE_ON_FATAL_EXCEPTION && wxUSE_DEBUGREPORT
854 void OnFatalException () override;
855#endif
856#endif
867 void OnAssertFailure(const wxChar *file, int line, const wxChar *func,
868 const wxChar *cond, const wxChar *msg) override;
882 static void NewWindow(const wxString &file = {}, bool evalOnStartup = false, bool exitAfterEval = false, unsigned char *wxmData = nullptr, std::size_t wxmLen = 0);
883
884 void OnFileMenu(wxCommandEvent &ev);
885
894 static std::vector<wxString> OpenableFiles(const std::vector<wxString> &files);
895
896#ifdef __WXMSW__
909 void DisableConsoleQuickEdit();
911 void RestoreConsoleMode();
912#endif // __WXMSW__
913
914#ifdef __WXMAC__
915 void MacNewFile() override;
916 void MacOpenFile(const wxString &file) override;
917#endif // __WXMAC__
918
919public:
920 static wxLogWindow *m_logWindow; // The wxWidgets log window, we use.
921
929 static std::unique_ptr<wxLogChain> m_logChain;
930 static std::vector<wxProcess *> m_wxMaximaProcesses;
931#ifdef USE_QA
932#if wxUSE_ON_FATAL_EXCEPTION && wxUSE_DEBUGREPORT
933 void GenerateDebugReport(wxDebugReport::Context ctx);
934#endif
935#endif
936 std::unique_ptr<wxLocale> m_locale;
937 std::unique_ptr<wxTranslations> m_translations;
938#ifdef __WXMSW__
940 unsigned long m_consoleModeToRestore = 0;
942 bool m_consoleModeChanged = false;
943#endif
945 wxString m_configFileName;
946 Dirstructure m_dirstruct;
947 static bool m_allWindowsInOneProcess;
948 std::unique_ptr<Configuration> m_configuration;
949};
950
951class MyDropTarget : public wxFileDropTarget
952{
953public:
954 explicit MyDropTarget(wxMaxima *wxmax)
955 { m_wxmax = wxmax; }
956
957 bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &files) override;
958
959private:
960 wxMaxima *m_wxmax = nullptr;
961};
962
963#endif
964
965
966// cppcheck-suppress noConstructor
967
968#endif // WXMAXIMA_H
This file declares the class DirStructure.
The header file for the xml cell parser.
The menu/toolbar command handlers wxMaxima binds to the "insert a Maxima command" menu and button eve...
Drives the evaluation of the worksheet: it pulls cells off the evaluation queue, sends their commands...
Loads and saves worksheet files (.wxmx, .wxm, .mac/.out, .xml) for wxMaxima.
Declares MaximaInterruptChannel, the connection wxMaxima interrupts Maxima through.
Appends Maxima's (and wxMaxima's own) output to the worksheet.
The wxMaxima-side owner of the Maxima process and its control socket.
The handlers that turn a chunk of data Maxima sent into a change to wxMaxima's state and worksheet.
Appearance
How wxMaxima chooses between the light and the dark style set.
Definition: Configuration.h:1150
An object that represents the directory structure wxMaxima is installed in.
Definition: Dirstructure.h:50
Definition: FindReplacePane.h:51
This class handles parsing the xml representation of a cell tree.
Definition: MathParser.h:56
The menu-command handlers extracted from the wxMaxima god class.
Definition: MaximaCommandMenus.h:49
The evaluation-queue driver / command protocol extracted from wxMaxima.
Definition: MaximaEvaluator.h:51
The worksheet file loaders/savers extracted from the wxMaxima god class.
Definition: MaximaFileIO.h:49
Handles the "<ipc>" tag from Maxima.
Definition: MaximaIPC.h:41
void ReadInputData(const wxString &data)
Reads the interprocess communications tag, used in test scripts, etc.
Definition: MaximaIPC.cpp:90
Definition: MaximaOutputAppender.h:43
The Maxima process/socket lifecycle extracted from the wxMaxima god class.
Definition: MaximaProcessManager.h:56
The Maxima-response handlers extracted from the wxMaxima god class.
Definition: MaximaResponseReader.h:58
Interface to the Maxima process.
Definition: Maxima.h:66
Definition: test_ImgCell.cpp:354
bool OnInit() override
Definition: test_ImgCell.cpp:367
void OpenHCaret(const wxString &txt={})
Place the cursor into a new cell where the horizontal cursor is.
Definition: Worksheet.h:1880
void QuestionAnswered()
Mark the current question from maxima as "answered"..
Definition: Worksheet.cpp:3539
The frame containing the menu and the sidebars.
Definition: wxMaximaFrame.h:75
A version number that can be compared using "<" and ">".
Definition: wxMaxima.h:197
Definition: wxMaxima.h:76
void OnIdle(wxIdleEvent &event)
The idle task that refreshes the gui (worksheet, menus, title line,...)
Definition: wxMaxima.cpp:1981
void StatusMsgDClick(wxMouseEvent &ev)
Issued on double click on the status message in the status bar.
Definition: wxMaxima.cpp:3547
int m_port
The port the actual maxima process (not its wrapper script) runs at.
Definition: wxMaxima.h:665
wxOutputStream * m_maximaStdin
The stdin of the maxima process. Normally unused (commands go over the socket), but sbcl's low-level ...
Definition: wxMaxima.h:659
bool m_dispReadOut
what is displayed in statusbar
Definition: wxMaxima.h:690
bool m_scheduleUpdateToc
True = schedule an update of the table of contents.
Definition: wxMaxima.h:680
void ShowTip(bool force)
Definition: wxMaxima.cpp:1739
void OnActivate(wxActivateEvent &event)
Called when this window is activated or deactivated.
Definition: wxMaxima.cpp:3838
static wxRegEx m_xmlOpeningTag
Looks if this opening tag is actually complete.
Definition: wxMaxima.h:334
bool IsInteractive() const
Is this an interactive session (as opposed to a batch run that will exit)?
Definition: wxMaxima.h:179
static wxString m_promptPrefix
The marker for the start of a input prompt.
Definition: wxMaxima.h:671
void OnMinimize(wxIconizeEvent &event)
Called when this window is minimized.
Definition: wxMaxima.cpp:3850
static const wxString Get_Maxima_Commandline_Filename()
The maxima command, if we use the –maxima=<str> command. If empty we use the configured path,...
Definition: wxMaxima.h:214
void ChangeCellStyle(wxCommandEvent &event)
Is triggered when the textstyle drop-down box's value is changed.
Definition: wxMaxima.cpp:3889
static wxString ExtraMaximaArgs()
Which additional maxima arguments did we get from the command line?
Definition: wxMaxima.h:122
bool m_isActive
Is this window active?
Definition: wxMaxima.h:364
void NetworkDClick(wxMouseEvent &ev)
Issued on double click on the network status.
Definition: wxMaxima.cpp:3539
void OnReplace(wxFindDialogEvent &event)
Is triggered when the "Replace" button in the search dialog is pressed.
Definition: wxMaxima.cpp:2917
int SaveDocumentP()
Tries or offers to save the document.
Definition: wxMaxima.cpp:3780
void AddDrawParameter(wxString cmd, int dimensionsOfNewDrawCommand=2)
Add a parameter to a draw command.
Definition: wxMaxima.cpp:2989
void ShowHelp(const wxString &keyword)
Try to determine if help is needed for maxima or wxMaxima and show this help.
Definition: wxMaxima.cpp:1932
static void ExtraMaximaArgs(const wxString &args)
Additional maxima arguments from the command line.
Definition: wxMaxima.h:120
void EvalOnStartup(bool eval)
Do we want to evaluate the document on startup?
Definition: wxMaxima.h:163
static void ExitOnError()
Exit if we encounter an error.
Definition: wxMaxima.h:86
void OnUpdateTOCEvent(wxCommandEvent &event)
Is called when something requests an update of the table of contents.
Definition: wxMaxima.cpp:2649
void UpdateMenus()
Enables and disables the Right menu buttons.
Definition: wxMaxima.cpp:2434
wxInputStream * m_maximaStdout
The stdout of the maxima process.
Definition: wxMaxima.h:653
void VarReadEvent(wxCommandEvent &event)
Spawn the "configure" menu.
Definition: wxMaxima.cpp:3306
static bool GetEnableIPC()
Do we allow maxima to click buttons in wxMaxima?
Definition: wxMaxima.h:118
std::unique_ptr< wxSocketServer, ServerDeleter > m_server
The server maxima connects to as client.
Definition: wxMaxima.h:649
wxTimer m_maximaStdoutPollTimer
A timer that polls for output from the maxima process.
Definition: wxMaxima.h:145
void OnFollow(wxCommandEvent &event)
Called when the "Scroll to currently evaluated" button is pressed.
Definition: wxMaxima.cpp:3636
bool DocumentSaved()
Does this document need saving?
Definition: wxMaxima.h:188
static void Set_Maxima_Commandline_Filename(const wxString &filename)
Use this maxima command (from a command line option) instead of the configured path.
Definition: wxMaxima.h:211
long long GetMaximaCpuTime()
How much CPU time has maxima used till now? Used by GetMaximaCPUPercentage.
Definition: wxMaxima.cpp:2693
void ReplaceSuggestion(wxCommandEvent &event)
Processes clicks on suggestions Make the menu item, toolbars and panes visible that should be visible...
Definition: wxMaxima.cpp:3418
void SetCWD(wxString file)
Set the current working directory file I/O from maxima is relative to.
Definition: wxMaxima.cpp:1544
static wxRegEx m_xmlOpeningTagName
Finds the name of an opening tag.
Definition: wxMaxima.h:332
void LoadImage(const wxString &file)
Load an image from a file into the worksheet.
Definition: wxMaxima.h:192
static void EnableIPC()
Allow maxima to click buttons in wxMaxima.
Definition: wxMaxima.h:116
void UpdateToolBar()
Enables and disables the Right toolbar buttons.
Definition: wxMaxima.cpp:2503
void ExportWorksheetToHtml(const wxString &filename, const wxString &flavor, bool embedWxmx)
Export the current worksheet to an HTML file (driven by wxworksheettohtml).
Definition: wxMaxima.cpp:2341
void HistoryDClick(wxCommandEvent &event)
Issued on double click on a history item.
Definition: wxMaxima.cpp:3613
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.
Definition: wxMaxima.cpp:1210
wxString GetCommand(bool params=true)
returns the command to start maxima The Maxima program GetCommand() runs, without asking the user any...
Definition: wxMaxima.cpp:1669
static wxString m_mathPrefix1
A marker for the start of maths.
Definition: wxMaxima.h:667
void OnFind(wxFindDialogEvent &event)
Is triggered when the "Find" button in the search dialog is pressed.
Definition: wxMaxima.cpp:2888
void OnSymbolAdd(wxCommandEvent &event)
Sends a new char to the symbols sidebar.
Definition: wxMaxima.cpp:2974
void LaunchHelpBrowser(const wxString &uri)
Launches the help browser on the uri passed as an argument.
Definition: wxMaxima.cpp:1755
void CommandWiz(const wxString &title, const wxString &description, const wxString &description_tooltip, const wxString &commandRule, const wxString &label1, const wxString &defaultval1, const wxString &tooltip1={}, const wxString &label2={}, const wxString &defaultval2={}, const wxString &tooltip2={}, const wxString &label3={}, const wxString &defaultval3={}, const wxString &tooltip3={}, const wxString &label4={}, const wxString &defaultval4={}, const wxString &tooltip4={}, const wxString &label5={}, const wxString &defaultval5={}, const wxString &tooltip5={}, const wxString &label6={}, const wxString &defaultval6={}, const wxString &tooltip6={}, const wxString &label7={}, const wxString &defaultval7={}, const wxString &tooltip7={}, const wxString &label8={}, const wxString &defaultval8={}, const wxString &tooltip8={}, const wxString &label9={}, const wxString &defaultval9={}, const wxString &tooltip9={}, const wxString &label10={}, const wxString &defaultval10={}, const wxString &tooltip10={})
Invoke our standard wizard that generates maxima commands.
Definition: wxMaxima.cpp:3023
wxInputStream * m_maximaStderr
The stderr of the maxima process.
Definition: wxMaxima.h:655
void ShowWxMaximaHelp(const wxString &anchor=wxEmptyString)
Show the help for wxMaxima.
Definition: wxMaxima.cpp:1839
bool ExitOnErrorArmed() const
Is THIS worksheet still set to exit on a Maxima error?
Definition: wxMaxima.h:99
void OnTextFormat(wxCommandEvent &event)
A character formatting button of the toolbar (bold, ...) was pressed.
Definition: wxMaxima.cpp:3857
bool m_maximaConnectWatchdogWarningShown
Have we already shown the "Maxima hasn't connected" warning this run?
Definition: wxMaxima.h:159
void VarAddAllEvent(wxCommandEvent &event)
Trigger adding all variables to the variables sidebar.
Definition: wxMaxima.cpp:3297
static bool GetExitOnError()
Do we exit if we encounter an error?
Definition: wxMaxima.h:88
ExitCode
Dedicated exit codes for a –batch/–exit-on-error run that aborted (GH #2276): every reason used to sh...
Definition: wxMaxima.h:226
@ EXIT_FILE_OPEN_FAILED
The file named on the command line could not be opened.
Definition: wxMaxima.h:233
@ EXIT_MAXIMA_ERROR
A cell reported a Maxima error and –exit-on-error is active.
Definition: wxMaxima.h:228
@ EXIT_UNANSWERED_QUESTION
Maxima asked an interactive question with no scripted answer available ("Halts on questions",...
Definition: wxMaxima.h:231
@ EXIT_FILE_SAVE_FAILED
Saving the worksheet (on exit, or a –batch run's own final save) failed.
Definition: wxMaxima.h:236
@ EXIT_IMAGE_LOAD_FAILED
An embedded image's data could not be loaded at all (GH #2178).
Definition: wxMaxima.h:238
@ EXIT_IMAGE_DECODE_FAILED
An embedded image failed to decode/render (GH #2178, –debug only).
Definition: wxMaxima.h:240
void OnTimerEvent(wxTimerEvent &event)
Is triggered when a timer this class is responsible for requires.
Definition: wxMaxima.cpp:2785
void PassKeyboardFocus()
Forwards the keyboard focus to a text control that might need it.
Definition: wxMaxima.cpp:3826
double GetMaximaCPUPercentage()
How much CPU horsepower is maxima using currently?
Definition: wxMaxima.cpp:2757
bool m_closing
Did we tell maxima to close?
Definition: wxMaxima.h:701
void ResetTitle(bool saved, bool force=false)
Update the title.
Definition: wxMaxima.cpp:3430
void OnJumpToError(wxCommandEvent &event)
Called when the "Scroll to last error" button is pressed.
wxString m_maximaTempDir
The directory with maxima's temp files.
Definition: wxMaxima.h:703
void OnReplaceAll(wxFindDialogEvent &event)
Is triggered when the "Replace All" button in the search dialog is pressed.
Definition: wxMaxima.cpp:2950
void MaximaDClick(wxMouseEvent &ev)
Issued on double click on the Maxima status icon.
Definition: wxMaxima.cpp:3543
wxProcess * m_gnuplotProcess
The gnuplot process info.
Definition: wxMaxima.h:336
void OnFocus(wxFocusEvent &event)
Called when this window is focussed or defocussed.
Definition: wxMaxima.cpp:3820
TimerIDs
An enum of individual IDs for all timers this class handles.
Definition: wxMaxima.h:126
@ KEYBOARD_INACTIVITY_TIMER_ID
The keyboard was inactive long enough that we can attempt an auto-save.
Definition: wxMaxima.h:128
@ AUTO_SAVE_TIMER_ID
The time between two auto-saves has elapsed.
Definition: wxMaxima.h:130
@ MAXIMA_CONNECT_WATCHDOG_ID
Maxima's process was started; has it connected back to us by now?
Definition: wxMaxima.h:134
@ MAXIMA_STDOUT_POLL_ID
We look if we got new data from maxima's stdout.
Definition: wxMaxima.h:132
void OnClose(wxCloseEvent &event)
close wxMaxima window
Definition: wxMaxima.cpp:3202
bool SaveNecessary()
Does this file contain anything worth saving?
Definition: wxMaxima.cpp:3281
wxProcess * m_gnuplotTerminalQueryProcess
Info about the gnuplot process we start for querying the terminals it supports.
Definition: wxMaxima.h:338
void StripLispComments(wxString &s)
Remove empty statements.
Definition: wxMaxima.cpp:1493
void MenuCommand(const wxString &cmd)
Inserts command cmd into the worksheet.
Definition: wxMaxima.cpp:2313
bool m_inLDB
True while sbcl is stopped in its low-level debugger (LDB). Set from the LDB banner on the process's ...
Definition: wxMaxima.h:663
static const wxString m_promptSuffix
The marker for the end of a input prompt.
Definition: wxMaxima.h:674
void ShowMaximaHelp(wxString={})
Show the help for Maxima.
Definition: wxMaxima.cpp:1948
wxString m_gnuplotProbedCommand
The gnuplot command whose terminal support we already probed.
Definition: wxMaxima.h:362
std::unique_ptr< MaximaInterruptChannel > m_interruptChannel
The second connection Maxima's Lisp opens so we can interrupt it.
Definition: wxMaxima.h:632
wxString GetCWD()
Get the current working directory file I/O from maxima is relative to.
Definition: wxMaxima.h:620
std::unique_ptr< GroupCell > CreateTreeFromXMLNode(wxXmlNode *xmlcells, const wxString &wxmxfilename={})
Loads a wxmx description.
Definition: wxMaxima.cpp:1602
void ShowPane(wxCommandEvent &event)
Toggle the visibility of a pane.
Definition: wxMaxima.cpp:3513
void ShowMaximaHelpWithoutAnchor()
Show the help for Maxima (without handling of anchors).
Definition: wxMaxima.cpp:1890
long long GetTotalCpuTime()
How much CPU time has been used by the system until now? Used by GetMaximaCPUPercentage.
Definition: wxMaxima.cpp:2658
wxString MaximaCommandArguments(bool params=true) const
What GetCommand() puts after the Maxima program: parameters and extra arguments.
Definition: wxMaxima.cpp:1659
wxString MaximaExecutable() const
Definition: wxMaxima.cpp:1645
void ShowTroubleshootingDialog()
Opens Help > Troubleshooting (GH #2559)
Definition: wxMaxima.cpp:1699
void ExitAfterEval(bool exitaftereval)
Do we want to exit the program after evaluation?
Definition: wxMaxima.cpp:1618
wxProcess * m_gnuplotPopoutCheckProcess
A second, hidden, headless gnuplot invocation of the same "Pop out interactively" script,...
Definition: wxMaxima.h:350
wxString m_gnuplotcommand
Maxima's idea about gnuplot's location.
Definition: wxMaxima.h:708
static wxString m_mathPrefix2
A marker for the start of maths.
Definition: wxMaxima.h:669
void UpdateSlider()
Updates the slider to show the right frame.
Definition: wxMaxima.cpp:3485
void TableOfContentsSelection(wxListEvent &event)
Issued on double click on a table of contents item.
Definition: wxMaxima.cpp:3619
void ConfigChanged()
Is called on start and whenever the configuration changes.
Definition: wxMaxima.cpp:231
wxTimer m_maximaConnectWatchdogTimer
Fires once, a few seconds after Maxima's process is started.
Definition: wxMaxima.h:157
wxString m_gnuplotPopoutCheckFile
The temp file m_gnuplotPopoutCheckProcess reads its script from; removed once OnGnuplotPopoutCheckClo...
Definition: wxMaxima.h:353
static wxString m_firstPrompt
The first prompt maxima will output.
Definition: wxMaxima.h:689
bool SaveOnClose()
Try to save the file before closing it - or return false.
Definition: wxMaxima.cpp:3168
void ExportWorksheetToTex(const wxString &filename, const wxString &documentclass, const wxString &documentclassOptions, bool embedWorksheet)
Export the current worksheet to a LaTeX file (driven by wxworksheettotex).
Definition: wxMaxima.cpp:2388
void func()
function in group 1
Definition: group.cpp:13
The Right Way to delete a wxSocketServer.
Definition: wxMaxima.h:638
This file declares the class wxMaximaFrame.
wxString ApplyAppearanceToApp(Configuration::Appearance appearance, bool logImmediately=true)
Apply the chosen light/dark appearance to the native application chrome (menus, toolbars,...
Definition: wxMaxima.cpp:176