wxMaxima
Loading...
Searching...
No Matches
MaximaEvaluator.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2026 Gunter Königsmann <wxMaxima@physikbuch.de>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
35#ifndef MAXIMAEVALUATOR_H
36#define MAXIMAEVALUATOR_H
37
38#include <wx/string.h>
39
40class wxMaxima;
41class wxCommandEvent;
42class GroupCell;
43
50{
51public:
52 explicit MaximaEvaluator(wxMaxima &wxm) : m_wxMaxima(wxm) {}
53
56 void SendMaxima(wxString s, bool addToHistory = false, bool background = false);
57
59 void FirstOutput();
60
65 bool AbortOnError();
66
71 bool QueryVariableValue();
72
75 void EvaluateEvent(wxCommandEvent &event);
76
79 void TriggerEvaluation();
80
86 void SetupVariables();
87
88private:
95 wxString LinelConfigCommand() const;
96
112 wxString CellIdConfigCommand(GroupCell *cell);
113
117 wxString m_lastSentCellId;
118
121 wxMaxima &m_wxMaxima;
122};
123
124#endif // MAXIMAEVALUATOR_H
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
The evaluation-queue driver / command protocol extracted from wxMaxima.
Definition: MaximaEvaluator.h:50
void SendMaxima(wxString s, bool addToHistory=false, bool background=false)
Sends a string to the Maxima process (optionally adding it to the history and/or marking it a backgro...
Definition: MaximaEvaluator.cpp:44
bool QueryVariableValue()
Queries the value of the next variable wxMaxima wants to know about.
Definition: MaximaEvaluator.cpp:137
void TriggerEvaluation()
If Maxima is idle and the queue is non-empty, sends the next command; otherwise settles the UI into i...
Definition: MaximaEvaluator.cpp:323
void SetupVariables()
Sends Maxima the one-time startup configuration.
Definition: MaximaEvaluator.cpp:611
void EvaluateEvent(wxCommandEvent &event)
The "evaluate" menu/hotkey handler: queues the active/selected cells and starts evaluation (or sends ...
Definition: MaximaEvaluator.cpp:229
void FirstOutput()
Prepares the worksheet once Maxima's first prompt has been seen.
Definition: MaximaEvaluator.cpp:38
bool AbortOnError()
Reacts to a Maxima error: decides whether to keep evaluating the queue.
Definition: MaximaEvaluator.cpp:173
Definition: wxMaxima.h:75