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 (wxString::const_iterator it = operators.begin();
67 it != operators.end(); ++it)
68 m_operators[wxString(*it)] = 1;
73 {
return m_operators.find(name) != m_operators.end(); }
75 void AddOperator(
const wxString &name) { m_operators[name] = 1; }
99 wxString
ShareDir()
const {
return m_shareDir; }
101 void ShareDir(wxString dir) { m_shareDir = std::move(dir); }
103 wxString
DemoDir()
const {
return m_demoDir; }
105 void DemoDir(wxString dir) { m_demoDir = std::move(dir); }
114 std::unordered_map<wxString, int, wxStringHash> m_operators;
116 wxString m_maximaVersion;
118 wxString m_maximaArch;
120 wxString m_lispVersion;
124 wxString m_workingDirectory;
130 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:95
bool InLispMode() const
Is maxima currently in lisp mode (where commands need no trailing ";")?
Definition: MaximaSessionInfo.h:108
void SetLispType(const wxString &type)
Sets the type of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:92
void SetMaximaArch(const wxString &arch)
Sets the processor architecture the connected Maxima runs on.
Definition: MaximaSessionInfo.h:84
wxString GetMaximaArch() const
The processor architecture the connected Maxima runs on.
Definition: MaximaSessionInfo.h:82
void InLispMode(bool lisp)
Tells us whether maxima currently is in lisp mode.
Definition: MaximaSessionInfo.h:110
wxString GetLispVersion() const
The version of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:86
wxString DemoDir() const
The directory maxima's demo files live in.
Definition: MaximaSessionInfo.h:103
void AddOperator(const wxString &name)
Registers name as an operator known to maxima.
Definition: MaximaSessionInfo.h:75
void SetWorkingDirectory(wxString dir)
Sets maxima's working directory.
Definition: MaximaSessionInfo.h:97
wxString ShareDir() const
The directory maxima's shared files (e.g. the manual) live in.
Definition: MaximaSessionInfo.h:99
void DemoDir(wxString dir)
Sets the directory maxima's demo files live in.
Definition: MaximaSessionInfo.h:105
wxString GetLispType() const
The type of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:90
void ShareDir(wxString dir)
Sets the directory maxima's shared files live in.
Definition: MaximaSessionInfo.h:101
void SetMaximaVersion(const wxString &version)
Sets the version of the connected Maxima.
Definition: MaximaSessionInfo.h:80
void SetLispVersion(const wxString &version)
Sets the version of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:88
wxString GetMaximaVersion() const
The version of the connected Maxima.
Definition: MaximaSessionInfo.h:78
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:72