24#ifndef WXMAXIMA_MAXIMA_H
25#define WXMAXIMA_MAXIMA_H
35#include <wx/sckstrm.h>
36#include <wx/txtstrm.h>
44#include "Configuration.h"
70 wxSocketBase *Socket()
const {
return m_socket.get(); }
79 static bool GetPipeToStdErr() {
return m_pipeToStderr; }
89 bool Write(
const void *buffer, std::size_t length);
108 XML_WATCH_VARIABLES_ADD,
110 XML_HTML_MANUAL_KEYWORDS,
120 STRING_FOR_XMLINSPECTOR,
122 void XmlInspectorActive(
bool active){m_xmlInspector = active;}
125 bool m_xmlInspector =
false;
129 jthread m_parserTask;
131 void SocketEvent(wxSocketEvent &event);
133 void TimerEvent(wxTimerEvent &event);
134 std::unique_ptr<wxSocketBase> m_socket;
135 std::mutex m_socketInputMutex;
137 wxSocketInputStream m_socketInput;
146 wxTextInputStream m_textInput;
154 wxString m_socketInputData;
157 bool m_firstPrompt =
true;
159 static bool m_pipeToStderr;
181 void SendToWxMaxima();
191 wxTimer m_readIdleTimer{
this};
193 static std::unordered_map<wxString, EventCause, wxStringHash> m_knownTags;
199 std::atomic_bool m_abortParserThread;
202wxDECLARE_EVENT(EVT_MAXIMA, wxThreadEvent);
The configuration storage for the current worksheet.
Definition: Configuration.h:85
Interface to the Maxima process.
Definition: Maxima.h:63
EventCause
Definition: Maxima.h:99
@ WRITE_PENDING
A write to Maxima is still ongoing. We use this event to keep the traffic indicator alive.
Definition: Maxima.h:117
@ READ_PENDING
There's still pending data coming from Maxima. The Data member is empty at the moment.
Definition: Maxima.h:101
@ WRITE_ERROR
The transmission has failed - this is an unrecoverable error, most likely.
Definition: Maxima.h:119
@ DISCONNECTED
Maxima has disconnected (possibly because the process had died).
Definition: Maxima.h:115
@ READ_MISC_TEXT
Maxima has sent non-XML text.
Definition: Maxima.h:103
void ReadSocket()
Read whatever data is in the socket. This is normally handled by the event handler,...
Definition: Maxima.cpp:160
static void GetPipeToStdErr(bool pipe)
Tells if the user wants all data to maxima to be copied to StdErr.
Definition: Maxima.h:78
static void SetPipeToStdErr(bool pipe)
Tells us if the user wants all data to maxima to be copied to StdErr.
Definition: Maxima.h:76
bool IsConnected() const
Are we connected to Maxima?
Definition: Maxima.h:73
bool Write(const void *buffer, std::size_t length)
Write more data to be sent to maxima.
Definition: Maxima.cpp:118
void ClearFirstPrompt()
Clear the first prompt state, based on what was read from maxima. This is called from prompt recogniz...
Definition: Maxima.h:97