34#ifndef MAXIMASESSIONINFO_H
35#define MAXIMASESSIONINFO_H
38#include <wx/hashmap.h>
39#include <unordered_map>
56 for (
const wxChar *op : {
57 wxS(
"("), wxS(
"/"), wxS(
"{"), wxS(
"-"), wxS(
"^"), wxS(
"#"),
58 wxS(
"="), wxS(
":"), wxS(
"["), wxS(
"'"), wxS(
"!"), wxS(
"+"),
59 wxS(
"*"), wxS(
"or"), wxS(
"and"), wxS(
"do_in"), wxS(
">"),
60 wxS(
"$SUBVAR"), wxS(
"<"), wxS(
"if"), wxS(
"::="), wxS(
"::"),
61 wxS(
"@"), wxS(
"."), wxS(
"-->"), wxS(
"^^"), wxS(
"not"),
62 wxS(
"<="), wxS(
":="), wxS(
">="), wxS(
"$BFLOAT"), wxS(
"do")})
64 wxString operators(wxS(
"\u221A\u22C0\u22C1\u22BB\u22BC\u22BD\u00AC\u222b"
65 "\u2264\u2265\u2211\u2260+-*/^:=#'!()[]{}"));
66 for (
const auto ch : operators)
67 m_operators[wxString(ch)] = 1;
72 {
return m_operators.contains(name); }
74 void AddOperator(
const wxString &name) { m_operators[name] = 1; }
98 wxString
ShareDir()
const {
return m_shareDir; }
100 void ShareDir(wxString dir) { m_shareDir = std::move(dir); }
102 wxString
DemoDir()
const {
return m_demoDir; }
104 void DemoDir(wxString dir) { m_demoDir = std::move(dir); }
113 std::unordered_map<wxString, int, wxStringHash> m_operators;
115 wxString m_maximaVersion;
117 wxString m_maximaArch;
119 wxString m_lispVersion;
123 wxString m_workingDirectory;
129 bool m_inLispMode =
false;
What we know about the Maxima instance we are talking to.
Definition: MaximaSessionInfo.h:48
wxString GetWorkingDirectory() const
Maxima's working directory.
Definition: MaximaSessionInfo.h:94
bool InLispMode() const
Is maxima currently in lisp mode (where commands need no trailing ";")?
Definition: MaximaSessionInfo.h:107
void SetLispType(const wxString &type)
Sets the type of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:91
void SetMaximaArch(const wxString &arch)
Sets the processor architecture the connected Maxima runs on.
Definition: MaximaSessionInfo.h:83
wxString GetMaximaArch() const
The processor architecture the connected Maxima runs on.
Definition: MaximaSessionInfo.h:81
void InLispMode(bool lisp)
Tells us whether maxima currently is in lisp mode.
Definition: MaximaSessionInfo.h:109
wxString GetLispVersion() const
The version of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:85
wxString DemoDir() const
The directory maxima's demo files live in.
Definition: MaximaSessionInfo.h:102
void AddOperator(const wxString &name)
Registers name as an operator known to maxima.
Definition: MaximaSessionInfo.h:74
void SetWorkingDirectory(wxString dir)
Sets maxima's working directory.
Definition: MaximaSessionInfo.h:96
wxString ShareDir() const
The directory maxima's shared files (e.g. the manual) live in.
Definition: MaximaSessionInfo.h:98
void DemoDir(wxString dir)
Sets the directory maxima's demo files live in.
Definition: MaximaSessionInfo.h:104
wxString GetLispType() const
The type of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:89
void ShareDir(wxString dir)
Sets the directory maxima's shared files live in.
Definition: MaximaSessionInfo.h:100
void SetMaximaVersion(const wxString &version)
Sets the version of the connected Maxima.
Definition: MaximaSessionInfo.h:79
void SetLispVersion(const wxString &version)
Sets the version of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:87
wxString GetMaximaVersion() const
The version of the connected Maxima.
Definition: MaximaSessionInfo.h:77
MaximaSessionInfo()
Constructs the session info with the built-in operator names seeded.
Definition: MaximaSessionInfo.h:51
bool IsOperator(const wxString &name) const
Is this name an operator known to maxima?
Definition: MaximaSessionInfo.h:71