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
35#include "BuildConfig.h"
36#include <vector>
37#include "wxMaximaFrame.h"
38#include "WXMXformat.h"
39#include "Configuration.h"
40#include "MathParser.h"
41#include "MaximaIPC.h"
42#include "MaximaCommandMenus.h"
45#include "MaximaEvaluator.h"
46#include "MaximaFileIO.h"
49#include "Dirstructure.h"
50#include <wx/socket.h>
51#include <wx/config.h>
52#include <wx/process.h>
53#include <wx/regex.h>
54#include <wx/dnd.h>
55#include <wx/txtstrm.h>
56#include <wx/sckstrm.h>
57#include <wx/buffer.h>
58#include <wx/power.h>
59#ifdef USE_QA
60#include <wx/debugrpt.h>
61#endif
62#include <memory>
63#include "Screenshot.h"
64#ifdef __WXMSW__
65#include <windows.h>
66#endif
67#include <unordered_map>
68
70#define MAXIMAPOLLMSECS 2000
71
72class Maxima; // The Maxima process interface
73
74namespace wxm { struct WizardSpec; }
75
76/* The top-level window and the main application logic
77
78 */
79
80class wxMaxima : public wxMaximaFrame
81{
82public:
83 wxMaxima(wxWindow *parent, int id, const wxString &title,
84 const wxString &filename = wxEmptyString,
85 const wxString &initialWorksheetContents = wxEmptyString,
86 const wxPoint pos = wxDefaultPosition, const wxSize size = wxDefaultSize);
87
88 ~wxMaxima() override;
89 wxString EscapeFilenameForShell(wxString name);
91 static void ExitOnError(){m_exitOnError = true;}
93 static bool GetExitOnError(){return m_exitOnError;}
104 bool ExitOnErrorArmed() const { return m_exitOnError && m_exitOnErrorArmed; }
105
106#ifdef __WXMSW__
115 static void RepairFileAssociations();
116#endif
121 static void EnableIPC(){ MaximaIPC::EnableIPC(); }
123 static bool GetEnableIPC(){ return MaximaIPC::GetEnableIPC(); }
125 static void ExtraMaximaArgs(const wxString &args){m_extraMaximaArgs = args;}
127 static wxString ExtraMaximaArgs(){return m_extraMaximaArgs;}
128
131 {
140 };
141
142#ifdef wxHAS_POWER_EVENTS
143 void OnPowerEvent(wxPowerEvent &event);
144#endif
145
147 void OnTimerEvent(wxTimerEvent &event);
148
151
165
166 void ShowTip(bool force);
168 void EvalOnStartup(bool eval)
169 {
170 m_evalOnStartup = eval;
171 }
172
174 void ExitAfterEval(bool exitaftereval);
184 bool IsInteractive() const { return !m_exitAfterEval; }
185
186 void StripLispComments(wxString &s);
187
189 void LaunchHelpBrowser(const wxString& uri);
190
191
194 { return m_fileSaved; }
195
197 void LoadImage(const wxString &file)
198 { GetWorksheet()->OpenHCaret(file, GC_TYPE_IMAGE); }
199
202 {
203 public:
204 explicit VersionNumber(const wxString &version);
205 long Major() const {return m_major;}
206 long Minor() const {return m_minor;}
207 long Patchlevel() const {return m_patchlevel;}
208 auto operator<=>(const VersionNumber&) const = default;
209 private:
210 long m_major = -1;
211 long m_minor = -1;
212 long m_patchlevel = -1;
213 };
214
216 static void Set_Maxima_Commandline_Filename(const wxString &filename)
217 {maxima_command_line_filename = filename;}
219 static const wxString Get_Maxima_Commandline_Filename() {return maxima_command_line_filename;}
220
231 enum ExitCode : int {
248 };
249
250 static int GetExitCode(){return m_exitCode;}
251
258 static void RequestScreenshot(const wxString &file,
259 const wxm::ScreenshotScene &scene)
260 {
261 m_screenshotFile = file;
262 m_screenshotScene = scene;
263 }
264
265private:
267 static wxString m_screenshotFile;
269 static wxm::ScreenshotScene m_screenshotScene;
271 bool m_screenshotStarted = false;
273 std::unique_ptr<wxTimer> m_screenshotTimer;
275 void StartScreenshot();
277 void TakeScreenshot(wxWindow *window, wxDialog *dialog);
279 static wxString maxima_command_line_filename;
281 bool m_maximaAuthenticated = false;
283 bool m_discardAllData = false;
285 wxString m_maximaAuthString;
287 MaximaIPC m_ipc{this};
290 static bool m_exitOnError;
294 bool m_exitOnErrorArmed = true;
296 static wxString m_extraMaximaArgs;
298 std::vector<wxString> m_varNamesToQuery;
299
301 bool m_openInitialFileError = false;
303 wxString EscapeForLisp(wxString str);
305 long long m_maximaJiffies_old = 0;
307 long long m_cpuTotalJiffies_old = 0;
310 wxString m_configCommands;
312 static wxRegEx m_gnuplotErrorRegex;
314 wxString m_oldFindString;
316 int m_oldFindFlags = 0;
318 bool m_hasEvaluatedCells = false;
320 long m_outputCellsFromCurrentCommand = 0;
322 long m_maxOutputCellsPerCommand = 0;
329 int m_unsuccessfulConnectionAttempts = 11;
331 wxString m_CWD;
333 bool m_evalOnStartup = false;
335 bool m_exitAfterEval = false;
337 bool m_ready = false;
338
343 wxString GetUnmatchedParenthesisState(wxString text, std::size_t &index);
345 wxMemoryBuffer m_uncompletedChars;
346
347protected:
349 void CommandWiz(const wxString &title,
350 const wxString &description, const wxString &description_tooltip,
351 const wxString &commandRule,
352 const wxString& label1, const wxString& defaultval1, const wxString& tooltip1 = {},
353 const wxString& label2 = {}, const wxString& defaultval2 = {}, const wxString& tooltip2 = {},
354 const wxString& label3 = {}, const wxString& defaultval3 = {}, const wxString& tooltip3 = {},
355 const wxString& label4 = {}, const wxString& defaultval4 = {}, const wxString& tooltip4 = {},
356 const wxString& label5 = {}, const wxString& defaultval5 = {}, const wxString& tooltip5 = {},
357 const wxString& label6 = {}, const wxString& defaultval6 = {}, const wxString& tooltip6 = {},
358 const wxString& label7 = {}, const wxString& defaultval7 = {}, const wxString& tooltip7 = {},
359 const wxString& label8 = {}, const wxString& defaultval8 = {}, const wxString& tooltip8 = {},
360 const wxString& label9 = {}, const wxString& defaultval9 = {}, const wxString& tooltip9 = {},
361 const wxString& label10 = {}, const wxString& defaultval10 = {}, const wxString& tooltip10 = {}
362 );
367 void CommandWiz(const wxm::WizardSpec &spec, const wxString &selection);
369 static wxRegEx m_xmlOpeningTagName;
371 static wxRegEx m_xmlOpeningTag;
373 wxProcess *m_gnuplotProcess = nullptr;
375 wxProcess *m_gnuplotTerminalQueryProcess = nullptr;
387 wxProcess *m_gnuplotPopoutCheckProcess = nullptr;
401 bool m_isActive = true;
403 void OnFocus(wxFocusEvent &event);
405 void OnActivate(wxActivateEvent &event);
406
408 void PassKeyboardFocus();
410 void OnMinimize(wxIconizeEvent &event);
412 void ConfigChanged();
414 void OnJumpToError(wxCommandEvent &event);
416 void OnSymbolAdd(wxCommandEvent &event);
418 void OnFollow(wxCommandEvent &event);
419 void OnWizardAbort(wxCommandEvent &event);
420 void OnWizardOK(wxCommandEvent &event);
421 void OnWizardInsert(wxCommandEvent &event);
422 void OnWizardHelpButton(wxCommandEvent &event);
423
425 void ShowMaximaHelp(wxString = {});
426
429
436 void ShowWxMaximaHelp(const wxString &anchor = wxEmptyString);
437
439 void ShowHelp(const wxString &keyword);
440
441 void CheckForUpdates(bool reportUpToDate = false);
442
443 void OnRecentDocument(wxCommandEvent &event);
444 void OnRecentPackage (wxCommandEvent &event);
445 void OnUnsavedDocument(wxCommandEvent &event);
446
447 void OnChar(wxKeyEvent &event);
448 void OnKeyDown(wxKeyEvent &event);
449
476 void OnIdle(wxIdleEvent &event);
477 bool m_dataFromMaximaIs = false;
478
479 void MenuCommand(const wxString &cmd);
480
487 void ExportWorksheetToHtml(const wxString &filename, const wxString &flavor,
488 bool embedWxmx);
489
498 void ExportWorksheetToTex(const wxString &filename,
499 const wxString &documentclass,
500 const wxString &documentclassOptions,
501 bool embedWorksheet);
507 void ExportWorksheetToPdf(const wxString &filename,
508 const PdfExport::Options &options);
509#ifdef __WXMSW__
511 void RegisterWxmxDiffTool();
512#endif
513 void ReplaceSuggestion(wxCommandEvent &event);
515 void UpdateMenus();
516 void UpdateToolBar();
517 void UpdateSlider();
521 void ShowPane(wxCommandEvent &event); //<! Makes a sidebar visible
522
524 void ChangeCellStyle(wxCommandEvent &event);
526 void OnTextFormat(wxCommandEvent &event);
527
529 void OnFind(wxFindDialogEvent &event);
530
532 void OnReplace(wxFindDialogEvent &event);
533
535 void OnReplaceAll(wxFindDialogEvent &event);
536
543 void AddDrawParameter(wxString cmd, int dimensionsOfNewDrawCommand = 2);
544
545 // The console output appenders (ConsoleAppend / DoConsoleAppend /
546 // DoRawConsoleAppend) and their AppendOpt options now live in
547 // MaximaOutputAppender (m_outputAppender).
548
554 void VarReadEvent(wxCommandEvent &event);
556 void VarAddAllEvent(wxCommandEvent &event);
557
558 void SliderEvent(wxScrollEvent &event);
559
561 void NetworkDClick(wxMouseEvent &ev);
563 void MaximaDClick(wxMouseEvent &ev);
565 void StatusMsgDClick(wxMouseEvent &ev);
566
567#ifdef WXM_USE_AI_TOOLS
570 void AiStatusClick(wxMouseEvent &ev);
573 void AiStatusDClick(wxMouseEvent &ev);
576 void AiStatusRightClick(wxMouseEvent &ev);
577#endif
578
580 void HistoryDClick(wxCommandEvent &event);
581
583 void TableOfContentsSelection(wxListEvent &event);
584
585 void OnInspectorEvent(wxCommandEvent &ev);
586
587 void DumpProcessOutput();
588
589
590 void TryUpdateInspector();
591
592 bool UpdateDrawPane();
593
594 wxString GetDefaultEntry();
595
596 void OnClose(wxCloseEvent &event);
597 wxString GetCommand(bool params = true);
599 wxString MaximaExecutable() const;
601 wxString MaximaCommandArguments(bool params = true) const;
604 // (uses guessConfiguration)
605
606 void ReadMaximaIPC(const wxString &data){m_ipc.ReadInputData(data);}
607
608 wxString m_maximaVariable_display2d;
609 wxString m_maximaVariable_altdisplay2d;
610 wxString m_maximaVariable_engineeringFormat;
611 bool m_readMaximaVariables = false;
612 bool m_updateAutocompletion = true;
617 long long GetTotalCpuTime();
618
624 long long GetMaximaCpuTime();
625
630 double GetMaximaCPUPercentage();
631
633 bool SaveNecessary();
634
635
643 void ResetTitle(bool saved, bool force = false);
644
646 std::unique_ptr<GroupCell> CreateTreeFromXMLNode(wxXmlNode *xmlcells, const wxString &wxmxfilename = {});
647
649 bool SaveOnClose();
650
658 int SaveDocumentP();
659
661 void SetCWD(wxString file);
662
664 wxString GetCWD()
665 {
666 return m_CWD;
667 }
668
669 std::unique_ptr<Maxima> m_client;
676 std::unique_ptr<MaximaInterruptChannel> m_interruptChannel;
683 void operator()(wxSocketServer* server) const {
684 server->Destroy(); // Destroy() calls Close() automatically.
685 }
686 };
693 std::unique_ptr<wxSocketServer, ServerDeleter> m_server;
694
695 wxProcess *m_maximaProcess = nullptr;
697 wxInputStream *m_maximaStdout = nullptr;
699 wxInputStream *m_maximaStderr = nullptr;
703 wxOutputStream *m_maximaStdin = nullptr;
707 bool m_inLDB = false;
709 int m_port = -1;
711 static wxString m_mathPrefix1;
713 static wxString m_mathPrefix2;
715 static wxString m_promptPrefix;
716public:
718 const static wxString m_promptSuffix;
719protected:
725 void QuestionAnswered(){if(GetWorksheet()) GetWorksheet()->QuestionAnswered();}
728 void OnNewDemoFiles(wxCommandEvent &event);
730 void OnUpdateTOCEvent(wxCommandEvent &event);
731
733 static wxString m_firstPrompt;
734 bool m_dispReadOut = false;
735 wxWindowIDRef m_gnuplot_process_id;
736 wxWindowIDRef m_maxima_process_id;
737 wxString m_lastPrompt;
738 wxString m_firstPromptBuffer;
739 wxString m_lastPath;
740 std::unique_ptr<wxPrintData> m_printData;
745 bool m_closing = false;
748 wxString m_maximaHtmlDir;
749 bool m_fileSaved = true;
750 static int m_exitCode;
753#ifdef __WINDOWS__
754 // For Windows, store "gnuplot.exe", even if wgnuplot.exe is preferred.
755 // We query the terminals using: gnuplot -e "print GPVAL_TERMINALS"
756 // and that does only work with gnuplot, not wgnuplot.
758 wxString m_gnuplotcommand_commandline;
759#endif
760 long m_commandIndex = -1;
762 static wxRegEx m_funRegEx;
763 static wxRegEx m_varRegEx;
764 static wxRegEx m_blankStatementRegEx;
765 static wxRegEx m_sbclCompilationRegEx;
766 MathParser m_parser;
767 bool m_maximaBusy = true;
768 bool m_maximaError = false;
769private:
770 wxString m_fileToOpen;
771 bool m_fourierLoaded = false;
772
773#if wxUSE_DRAG_AND_DROP
774
775 friend class MyDropTarget;
776
777#endif
778 friend class MaximaIPC;
781 friend class MaximaCommandMenus;
793 friend class MaximaEvaluator;
797 friend class MaximaFileIO;
802
813 wxTimer m_autoSaveTimer;
814
815 /* A timer that delays redraws while maxima evaluates
816
817 If we always start a redraw when maxima has nearly finished a command that slows
818 down evaluating many simple commands in a row.
819 */
820 wxTimer m_fastResponseTimer;
821
823 void StartAutoSaveTimer();
827 MaximaCommandMenus m_menuCommands;
832 MaximaResponseReader m_responseReader;
836 MaximaProcessManager m_processManager;
840 MaximaEvaluator m_evaluator;
844 MaximaFileIO m_fileIO;
848 MaximaOutputAppender m_outputAppender;
849};
850
872 bool logImmediately = true);
873
874#if wxUSE_DRAG_AND_DROP
875
876// cppcheck-suppress noConstructor
877class MyApp : public wxApp
878{
879public:
880 bool OnInit() override;
881 int OnRun() override;
882 int OnExit() override;
883 // Both guards are needed, and in this order: the definition in main.cpp
884 // carries exactly the same pair, and GenerateDebugReport() -- the QA-only
885 // method this one calls -- is already declared under both further down.
886 // Declaring an override that no translation unit defines does not merely
887 // waste a line: it is emitted into MyApp's vtable, so the link fails with
888 // "undefined reference to MyApp::OnFatalException()" pointing at
889 // _ZTV5MyApp rather than at any call site. That is what a
890 // -DWXM_DISABLE_QA=YES build hit.
891 // The macro is USE_QA, not WXM_USE_QA: WXM_USE_QA is the *CMake option*,
892 // and src/BuildConfig.h.cin turns it into #cmakedefine USE_QA. Guarding on
893 // the option name instead compiles to "never", which removes the
894 // declaration from the default build too, where main.cpp still defines the
895 // member.
896#ifdef USE_QA
897#if wxUSE_ON_FATAL_EXCEPTION && wxUSE_DEBUGREPORT
898 void OnFatalException () override;
899#endif
900#endif
911 void OnAssertFailure(const wxChar *file, int line, const wxChar *func,
912 const wxChar *cond, const wxChar *msg) override;
926 static void NewWindow(const wxString &file = {}, bool evalOnStartup = false, bool exitAfterEval = false, unsigned char *wxmData = nullptr, std::size_t wxmLen = 0);
927
928 void OnFileMenu(wxCommandEvent &ev);
929
938 static std::vector<wxString> OpenableFiles(const std::vector<wxString> &files);
939
940#ifdef __WXMSW__
953 void DisableConsoleQuickEdit();
955 void RestoreConsoleMode();
956#endif // __WXMSW__
957
958#ifdef __WXMAC__
959 void MacNewFile() override;
960 void MacOpenFile(const wxString &file) override;
961#endif // __WXMAC__
962
963public:
964 static wxLogWindow *m_logWindow; // The wxWidgets log window, we use.
965
973 static std::unique_ptr<wxLogChain> m_logChain;
974 static std::vector<wxProcess *> m_wxMaximaProcesses;
975#ifdef USE_QA
976#if wxUSE_ON_FATAL_EXCEPTION && wxUSE_DEBUGREPORT
977 void GenerateDebugReport(wxDebugReport::Context ctx);
978#endif
979#endif
980 std::unique_ptr<wxLocale> m_locale;
981 std::unique_ptr<wxTranslations> m_translations;
982#ifdef __WXMSW__
984 unsigned long m_consoleModeToRestore = 0;
986 bool m_consoleModeChanged = false;
987#endif
989 wxString m_configFileName;
990 Dirstructure m_dirstruct;
991 static bool m_allWindowsInOneProcess;
992 std::unique_ptr<Configuration> m_configuration;
993};
994
995class MyDropTarget : public wxFileDropTarget
996{
997public:
998 explicit MyDropTarget(wxMaxima *wxmax)
999 { m_wxmax = wxmax; }
1000
1001 bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &files) override;
1002
1003private:
1004 wxMaxima *m_wxmax = nullptr;
1005};
1006
1007#endif
1008
1009
1010// cppcheck-suppress noConstructor
1011
1012#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.
Declares PdfExport, which writes a worksheet to a tagged (accessible) PDF.
Screenshots for the manual, made by wxMaxima itself (–screenshot).
Appearance
How wxMaxima chooses between the light and the dark style set.
Definition: Configuration.h:1174
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:1890
void QuestionAnswered()
Mark the current question from maxima as "answered"..
Definition: Worksheet.cpp:3564
The frame containing the menu and the sidebars.
Definition: wxMaximaFrame.h:75
A version number that can be compared using "<" and ">".
Definition: wxMaxima.h:202
Definition: wxMaxima.h:81
void OnIdle(wxIdleEvent &event)
The idle task that refreshes the gui (worksheet, menus, title line,...)
Definition: wxMaxima.cpp:1852
void StatusMsgDClick(wxMouseEvent &ev)
Issued on double click on the status message in the status bar.
Definition: wxMaxima.cpp:3592
int m_port
The port the actual maxima process (not its wrapper script) runs at.
Definition: wxMaxima.h:709
wxOutputStream * m_maximaStdin
The stdin of the maxima process. Normally unused (commands go over the socket), but sbcl's low-level ...
Definition: wxMaxima.h:703
bool m_dispReadOut
what is displayed in statusbar
Definition: wxMaxima.h:734
bool m_scheduleUpdateToc
True = schedule an update of the table of contents.
Definition: wxMaxima.h:724
void ShowTip(bool force)
Definition: wxMaxima.cpp:1610
void OnActivate(wxActivateEvent &event)
Called when this window is activated or deactivated.
Definition: wxMaxima.cpp:3883
static wxRegEx m_xmlOpeningTag
Looks if this opening tag is actually complete.
Definition: wxMaxima.h:371
bool IsInteractive() const
Is this an interactive session (as opposed to a batch run that will exit)?
Definition: wxMaxima.h:184
static wxString m_promptPrefix
The marker for the start of a input prompt.
Definition: wxMaxima.h:715
void OnMinimize(wxIconizeEvent &event)
Called when this window is minimized.
Definition: wxMaxima.cpp:3895
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:219
void ChangeCellStyle(wxCommandEvent &event)
Is triggered when the textstyle drop-down box's value is changed.
Definition: wxMaxima.cpp:3934
static wxString ExtraMaximaArgs()
Which additional maxima arguments did we get from the command line?
Definition: wxMaxima.h:127
bool m_isActive
Is this window active?
Definition: wxMaxima.h:401
void NetworkDClick(wxMouseEvent &ev)
Issued on double click on the network status.
Definition: wxMaxima.cpp:3584
void OnReplace(wxFindDialogEvent &event)
Is triggered when the "Replace" button in the search dialog is pressed.
Definition: wxMaxima.cpp:2943
int SaveDocumentP()
Tries or offers to save the document.
Definition: wxMaxima.cpp:3825
void AddDrawParameter(wxString cmd, int dimensionsOfNewDrawCommand=2)
Add a parameter to a draw command.
Definition: wxMaxima.cpp:3015
void ShowHelp(const wxString &keyword)
Try to determine if help is needed for maxima or wxMaxima and show this help.
Definition: wxMaxima.cpp:1803
static void ExtraMaximaArgs(const wxString &args)
Additional maxima arguments from the command line.
Definition: wxMaxima.h:125
void EvalOnStartup(bool eval)
Do we want to evaluate the document on startup?
Definition: wxMaxima.h:168
static void ExitOnError()
Exit if we encounter an error.
Definition: wxMaxima.h:91
void OnUpdateTOCEvent(wxCommandEvent &event)
Is called when something requests an update of the table of contents.
Definition: wxMaxima.cpp:2675
void UpdateMenus()
Enables and disables the Right menu buttons.
Definition: wxMaxima.cpp:2460
wxInputStream * m_maximaStdout
The stdout of the maxima process.
Definition: wxMaxima.h:697
void VarReadEvent(wxCommandEvent &event)
Spawn the "configure" menu.
Definition: wxMaxima.cpp:3351
static bool GetEnableIPC()
Do we allow maxima to click buttons in wxMaxima?
Definition: wxMaxima.h:123
std::unique_ptr< wxSocketServer, ServerDeleter > m_server
The server maxima connects to as client.
Definition: wxMaxima.h:693
wxTimer m_maximaStdoutPollTimer
A timer that polls for output from the maxima process.
Definition: wxMaxima.h:150
void OnFollow(wxCommandEvent &event)
Called when the "Scroll to currently evaluated" button is pressed.
Definition: wxMaxima.cpp:3681
bool DocumentSaved()
Does this document need saving?
Definition: wxMaxima.h:193
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:216
long long GetMaximaCpuTime()
How much CPU time has maxima used till now? Used by GetMaximaCPUPercentage.
Definition: wxMaxima.cpp:2719
void ReplaceSuggestion(wxCommandEvent &event)
Processes clicks on suggestions Make the menu item, toolbars and panes visible that should be visible...
Definition: wxMaxima.cpp:3463
void SetCWD(wxString file)
Set the current working directory file I/O from maxima is relative to.
Definition: wxMaxima.cpp:1415
static wxRegEx m_xmlOpeningTagName
Finds the name of an opening tag.
Definition: wxMaxima.h:369
void LoadImage(const wxString &file)
Load an image from a file into the worksheet.
Definition: wxMaxima.h:197
static void EnableIPC()
Allow maxima to click buttons in wxMaxima.
Definition: wxMaxima.h:121
void UpdateToolBar()
Enables and disables the Right toolbar buttons.
Definition: wxMaxima.cpp:2529
void ExportWorksheetToHtml(const wxString &filename, const wxString &flavor, bool embedWxmx)
Export the current worksheet to an HTML file (driven by wxworksheettohtml).
Definition: wxMaxima.cpp:2344
void HistoryDClick(wxCommandEvent &event)
Issued on double click on a history item.
Definition: wxMaxima.cpp:3658
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:1081
wxString GetCommand(bool params=true)
returns the command to start maxima The Maxima program GetCommand() runs, without asking the user any...
Definition: wxMaxima.cpp:1540
static wxString m_mathPrefix1
A marker for the start of maths.
Definition: wxMaxima.h:711
void OnFind(wxFindDialogEvent &event)
Is triggered when the "Find" button in the search dialog is pressed.
Definition: wxMaxima.cpp:2914
void OnSymbolAdd(wxCommandEvent &event)
Sends a new char to the symbols sidebar.
Definition: wxMaxima.cpp:3000
void LaunchHelpBrowser(const wxString &uri)
Launches the help browser on the uri passed as an argument.
Definition: wxMaxima.cpp:1626
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:3049
wxInputStream * m_maximaStderr
The stderr of the maxima process.
Definition: wxMaxima.h:699
void ShowWxMaximaHelp(const wxString &anchor=wxEmptyString)
Show the help for wxMaxima.
Definition: wxMaxima.cpp:1710
bool ExitOnErrorArmed() const
Is THIS worksheet still set to exit on a Maxima error?
Definition: wxMaxima.h:104
void OnTextFormat(wxCommandEvent &event)
A character formatting button of the toolbar (bold, ...) was pressed.
Definition: wxMaxima.cpp:3902
bool m_maximaConnectWatchdogWarningShown
Have we already shown the "Maxima hasn't connected" warning this run?
Definition: wxMaxima.h:164
void VarAddAllEvent(wxCommandEvent &event)
Trigger adding all variables to the variables sidebar.
Definition: wxMaxima.cpp:3342
static bool GetExitOnError()
Do we exit if we encounter an error?
Definition: wxMaxima.h:93
ExitCode
Dedicated exit codes for a –batch/–exit-on-error run that aborted (GH #2276): every reason used to sh...
Definition: wxMaxima.h:231
@ EXIT_FILE_OPEN_FAILED
The file named on the command line could not be opened.
Definition: wxMaxima.h:238
@ EXIT_MAXIMA_ERROR
A cell reported a Maxima error and –exit-on-error is active.
Definition: wxMaxima.h:233
@ EXIT_UNANSWERED_QUESTION
Maxima asked an interactive question with no scripted answer available ("Halts on questions",...
Definition: wxMaxima.h:236
@ EXIT_FILE_SAVE_FAILED
Saving the worksheet (on exit, or a –batch run's own final save) failed.
Definition: wxMaxima.h:241
@ EXIT_SCREENSHOT_FAILED
–screenshot could not show or save what it was asked for
Definition: wxMaxima.h:247
@ EXIT_IMAGE_LOAD_FAILED
An embedded image's data could not be loaded at all (GH #2178).
Definition: wxMaxima.h:243
@ EXIT_IMAGE_DECODE_FAILED
An embedded image failed to decode/render (GH #2178, –debug only).
Definition: wxMaxima.h:245
void OnTimerEvent(wxTimerEvent &event)
Is triggered when a timer this class is responsible for requires.
Definition: wxMaxima.cpp:2811
void PassKeyboardFocus()
Forwards the keyboard focus to a text control that might need it.
Definition: wxMaxima.cpp:3871
double GetMaximaCPUPercentage()
How much CPU horsepower is maxima using currently?
Definition: wxMaxima.cpp:2783
static void RequestScreenshot(const wxString &file, const wxm::ScreenshotScene &scene)
Make this session's window save a screenshot and exit (–screenshot)
Definition: wxMaxima.h:258
bool m_closing
Did we tell maxima to close?
Definition: wxMaxima.h:745
void ResetTitle(bool saved, bool force=false)
Update the title.
Definition: wxMaxima.cpp:3475
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:747
void OnReplaceAll(wxFindDialogEvent &event)
Is triggered when the "Replace All" button in the search dialog is pressed.
Definition: wxMaxima.cpp:2976
void MaximaDClick(wxMouseEvent &ev)
Issued on double click on the Maxima status icon.
Definition: wxMaxima.cpp:3588
wxProcess * m_gnuplotProcess
The gnuplot process info.
Definition: wxMaxima.h:373
void OnFocus(wxFocusEvent &event)
Called when this window is focussed or defocussed.
Definition: wxMaxima.cpp:3865
TimerIDs
An enum of individual IDs for all timers this class handles.
Definition: wxMaxima.h:131
@ KEYBOARD_INACTIVITY_TIMER_ID
The keyboard was inactive long enough that we can attempt an auto-save.
Definition: wxMaxima.h:133
@ AUTO_SAVE_TIMER_ID
The time between two auto-saves has elapsed.
Definition: wxMaxima.h:135
@ MAXIMA_CONNECT_WATCHDOG_ID
Maxima's process was started; has it connected back to us by now?
Definition: wxMaxima.h:139
@ MAXIMA_STDOUT_POLL_ID
We look if we got new data from maxima's stdout.
Definition: wxMaxima.h:137
void OnClose(wxCloseEvent &event)
close wxMaxima window
Definition: wxMaxima.cpp:3247
bool SaveNecessary()
Does this file contain anything worth saving?
Definition: wxMaxima.cpp:3326
wxProcess * m_gnuplotTerminalQueryProcess
Info about the gnuplot process we start for querying the terminals it supports.
Definition: wxMaxima.h:375
void StripLispComments(wxString &s)
Remove empty statements.
Definition: wxMaxima.cpp:1364
void MenuCommand(const wxString &cmd)
Inserts command cmd into the worksheet.
Definition: wxMaxima.cpp:2316
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:707
static const wxString m_promptSuffix
The marker for the end of a input prompt.
Definition: wxMaxima.h:718
void ShowMaximaHelp(wxString={})
Show the help for Maxima.
Definition: wxMaxima.cpp:1819
wxString m_gnuplotProbedCommand
The gnuplot command whose terminal support we already probed.
Definition: wxMaxima.h:399
std::unique_ptr< MaximaInterruptChannel > m_interruptChannel
The second connection Maxima's Lisp opens so we can interrupt it.
Definition: wxMaxima.h:676
wxString GetCWD()
Get the current working directory file I/O from maxima is relative to.
Definition: wxMaxima.h:664
std::unique_ptr< GroupCell > CreateTreeFromXMLNode(wxXmlNode *xmlcells, const wxString &wxmxfilename={})
Loads a wxmx description.
Definition: wxMaxima.cpp:1473
void ShowPane(wxCommandEvent &event)
Toggle the visibility of a pane.
Definition: wxMaxima.cpp:3558
void ShowMaximaHelpWithoutAnchor()
Show the help for Maxima (without handling of anchors).
Definition: wxMaxima.cpp:1761
long long GetTotalCpuTime()
How much CPU time has been used by the system until now? Used by GetMaximaCPUPercentage.
Definition: wxMaxima.cpp:2684
wxString MaximaCommandArguments(bool params=true) const
What GetCommand() puts after the Maxima program: parameters and extra arguments.
Definition: wxMaxima.cpp:1530
wxString MaximaExecutable() const
Definition: wxMaxima.cpp:1516
void ShowTroubleshootingDialog()
Opens Help > Troubleshooting (GH #2559)
Definition: wxMaxima.cpp:1570
void ExitAfterEval(bool exitaftereval)
Do we want to exit the program after evaluation?
Definition: wxMaxima.cpp:1489
wxProcess * m_gnuplotPopoutCheckProcess
A second, hidden, headless gnuplot invocation of the same "Pop out interactively" script,...
Definition: wxMaxima.h:387
wxString m_gnuplotcommand
Maxima's idea about gnuplot's location.
Definition: wxMaxima.h:752
static wxString m_mathPrefix2
A marker for the start of maths.
Definition: wxMaxima.h:713
void UpdateSlider()
Updates the slider to show the right frame.
Definition: wxMaxima.cpp:3530
void TableOfContentsSelection(wxListEvent &event)
Issued on double click on a table of contents item.
Definition: wxMaxima.cpp:3664
void ConfigChanged()
Is called on start and whenever the configuration changes.
Definition: wxMaxima.cpp:233
wxTimer m_maximaConnectWatchdogTimer
Fires once, a few seconds after Maxima's process is started.
Definition: wxMaxima.h:162
wxString m_gnuplotPopoutCheckFile
The temp file m_gnuplotPopoutCheckProcess reads its script from; removed once OnGnuplotPopoutCheckClo...
Definition: wxMaxima.h:390
void ExportWorksheetToPdf(const wxString &filename, const PdfExport::Options &options)
Export the worksheet to a tagged PDF file, for wxworksheettopdf()
Definition: wxMaxima.cpp:2391
static wxString m_firstPrompt
The first prompt maxima will output.
Definition: wxMaxima.h:733
bool SaveOnClose()
Try to save the file before closing it - or return false.
Definition: wxMaxima.cpp:3213
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:2414
void func()
function in group 1
Definition: group.cpp:13
What goes into the PDF besides the worksheet.
Definition: PdfExport.h:66
The Right Way to delete a wxSocketServer.
Definition: wxMaxima.h:682
Everything a scene's [Screenshot] group asks for.
Definition: Screenshot.h:68
Everything the generic wizard needs to know about one menu command.
Definition: WizardCatalog.h:87
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:178