22#ifndef CONFIGURATION_H
23#define CONFIGURATION_H
28#include <wx/display.h>
29#include <wx/fontenum.h>
30#include <wx/hashmap.h>
36#include <unordered_map>
42#include <wx/wupdlock.h>
45#define MC_LINE_SKIP Scale_Px(2)
46#define MC_TEXT_PADDING Scale_Px(1)
48#define PAREN_OPEN_TOP_UNICODE "\u239b"
49#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
50#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
51#define PAREN_CLOSE_TOP_UNICODE "\u239e"
52#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
53#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
54#define SUM_SIGN "\u2211"
55#define PROD_SIGN "\u220F"
60#define MC_HCARET_WIDTH 25
62#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
63static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
64static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
67#define LABELWIDTH_MIN 3
68#define LABELWIDTH_MAX 10
89 std::atomic<long> manualAnchorsFromBuiltin{0};
90 std::atomic<long> manualAnchorsFromCache{0};
91 std::atomic<long> manualAnchorsCompiled{0};
92 std::atomic<long> maximaProcessesSpawned{0};
93 std::atomic<long> fontCacheHits{0};
94 std::atomic<long> fontCacheMisses{0};
95 std::atomic<long> recalculationNeeded_FontInvalid{0};
96 std::atomic<long> recalculationNeeded_SizeInvalid{0};
97 std::atomic<long> recalculationNeeded_FontMismatch{0};
98 std::atomic<long> recalculationNeeded_ConfigChanged{0};
99 std::atomic<long> recalculationNeeded_CellsAppended{0};
100 std::atomic<long> recalculationNeeded_EditorDirty{0};
101 std::atomic<long> cellsConvertedToLinear{0};
102 std::atomic<long> cellsConvertedTo2D{0};
107 enum maximaHelpFormat{
119 html_export_invalidChoice
122 enum showLabels : int8_t
124 labels_automatic = 0,
125 labels_prefer_user = 1,
128 labels_invalidSelection
151 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
152 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
153 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
159 const wxEnvVariableHashMap& MaximaEnvVars()
const {
return m_maximaEnvVars;}
160 wxEnvVariableHashMap m_maximaEnvVars;
169 { m_workingdir = std::move(dir); }
173 {
return m_workingdir; }
193 void UnsetContext() {m_dc = NULL;}
216 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
217 using EscCodeIterator = EscCodeContainer::const_iterator;
220 static const wxString &
GetEscCode(
const wxString &key);
256 {
return m_hideBrackets; }
263 {
return m_printScale; }
268 void PrintMargin_Top(
double margin){m_printMargin_Top = margin;}
269 void PrintMargin_Bot(
double margin){m_printMargin_Bot = margin;}
270 void PrintMargin_Left(
double margin){m_printMargin_Left = margin;}
271 void PrintMargin_Right(
double margin){m_printMargin_Right = margin;}
272 double PrintMargin_Top()
const {
return m_printMargin_Top;}
273 double PrintMargin_Bot()
const {
return m_printMargin_Bot;}
274 double PrintMargin_Left()
const {
return m_printMargin_Left;}
275 double PrintMargin_Right()
const {
return m_printMargin_Right;}
282 if(m_zoomFactor != newzoom)
284 m_zoomFactor = newzoom;
296 {
return m_zoomFactor; }
302 void SetRecalcDC(wxDC *dc)
305 wxString GetFontName(
TextStyle ts = TS_CODE_DEFAULT)
const;
309 wxString GetSymbolFontName()
const;
314 return wxString(wxS(
"°,\\'\"()[]-{}^+*/&§?:;=#<>$"));
317 wxFontWeight IsBold(
long st)
const;
319 wxFontStyle IsItalic(
long st)
const;
321 bool IsUnderlined(
long st)
const {
return m_styles[st].IsUnderlined();}
328 {
return m_labelWidth * 14; }
332 {
return m_labelWidth; }
336 if(m_labelWidth != labelWidth)
338 m_labelWidth = labelWidth;
356 int AutosaveMinutes()
const {
return m_autoSaveMinutes;}
357 void AutosaveMinutes(
int minutes){m_autoSaveMinutes = minutes;}
399 if(m_indent != indent)
404 bool IncrementalSearch()
const {
return m_incrementalSearch;}
407 void IncrementalSearch(
bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
409 int MaxLayoutTime()
const {
return m_maxLayoutTime; }
410 void MaxLayoutTime(
int time) { m_maxLayoutTime = time; }
415 CharsExist(
const wxString &chars,
bool exist) : chars(chars), exist(exist) {}
417 std::vector<CharsExist> m_charsInFont;
422 m_charsInFont.clear();
439 return m_lineWidth_em;
444 bool AutoSaveAsTempFile()
const {
return m_autoSaveAsTempFile;}
445 void AutoSaveAsTempFile(
bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
449 { m_lineWidth_em = width; }
456 bool SaveUntitled()
const {
return m_saveUntitled;}
457 void SaveUntitled(
bool save) {m_saveUntitled = save;}
459 bool CursorJump()
const {
return m_cursorJump;}
460 void CursorJump(
bool save){m_cursorJump = save;}
462 bool NumpadEnterEvaluates()
const {
return m_numpadEnterEvaluates;}
463 void NumpadEnterEvaluates(
bool eval){m_numpadEnterEvaluates = eval;}
465 bool SaveImgFileName()
const {
return m_saveImgFileName;}
466 void SaveImgFileName(
bool save) { m_saveImgFileName = save;}
470 {
return m_autoWrap > 0; }
487 {
return m_autoIndent; }
489 void SetAutoIndent(
bool autoIndent){m_autoIndent = autoIndent;}
494 if(m_indentMaths != indent)
496 m_indentMaths = indent;}
499 static const wxString &GetStyleName(
TextStyle textStyle);
515 void MakeStylesConsistent();
516 void Outdated(
bool outdated)
517 { m_outdated = outdated; }
521 {
return m_keepPercent; }
526 if(m_keepPercent != keepPercent)
528 m_keepPercent = keepPercent;
531 wxString GetTeXCMRI()
const
532 {
return m_fontCMRI; }
534 wxString GetTeXCMSY()
const
535 {
return m_fontCMSY; }
537 wxString GetTeXCMEX()
const
538 {
return m_fontCMEX; }
540 wxString GetTeXCMMI()
const
541 {
return m_fontCMMI; }
543 wxString GetTeXCMTI()
const
544 {
return m_fontCMTI; }
546 bool ShowCodeCells()
const
547 {
return m_showCodeCells; }
549 void ShowCodeCells(
bool show);
566 {
return m_printing; }
580 bool UsePngCairo()
const {
return m_usepngCairo;}
581 void UsePngCairo(
bool usepngCairo) { m_usepngCairo = usepngCairo;}
583 bool GetMatchParens()
const {
return m_matchParens; }
584 void SetMatchParens(
bool matchParens) { m_matchParens = matchParens; }
585 bool ShowMatchingParens()
const {
return m_showMatchingParens; }
586 void ShowMatchingParens(
bool show) { m_showMatchingParens = show; }
593 if(m_changeAsterisk != changeAsterisk)
595 m_changeAsterisk = changeAsterisk;
598 bool HidemultiplicationSign()
const {
return m_hidemultiplicationsign;}
600 void HidemultiplicationSign(
bool show) {
601 if(m_hidemultiplicationsign != show)
603 m_hidemultiplicationsign = show;
606 bool Latin2Greek()
const
607 {
return m_latin2greek;}
609 void Latin2Greek(
bool latin2greek) {
610 if(m_latin2greek != latin2greek)
612 m_latin2greek = latin2greek;
615 bool GreekSidebar_ShowLatinLookalikes()
const {
return m_greekSidebar_ShowLatinLookalikes;}
616 void GreekSidebar_ShowLatinLookalikes(
bool show){m_greekSidebar_ShowLatinLookalikes = show;}
618 bool GreekSidebar_Show_mu()
const {
return m_greekSidebar_Show_mu;}
619 void GreekSidebar_Show_mu(
bool show) {m_greekSidebar_Show_mu = show;}
621 wxString SymbolPaneAdditionalChars()
const
622 {
return m_symbolPaneAdditionalChars;}
623 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
627 {
return m_notifyIfIdle; }
629 void NotifyIfIdle(
bool notify) {m_notifyIfIdle = notify;}
636 {
return m_displayedDigits; }
638 void SetDisplayedDigits(
long displayedDigits)
640 wxASSERT_MSG(displayedDigits >= 0, _(
"Bug: Maximum number of digits that is to be displayed is too low!"));
641 if(m_displayedDigits != displayedDigits)
643 m_displayedDigits = displayedDigits;
650 FileToSave(
const wxString &filename,
const wxMemoryBuffer &data):
655 const wxString FileName()
const{
return m_filename;}
656 const wxMemoryBuffer Data()
const{
return m_data;}
658 const wxMemoryBuffer m_data;
659 const wxString m_filename;
666 TextsnippetToDraw(
const wxPoint &pos,
const wxString &text,
const wxColor &color):
672 const wxPoint Pos()
const{
return m_pos;}
673 const wxString Text()
const{
return m_text;}
674 const wxColor Color()
const{
return m_color;}
677 const wxString m_text;
678 const wxColor m_color;
682 void PushFileToSave(
const wxString &filename,
const wxMemoryBuffer &data)
683 { m_filesToSave.emplace_front(
FileToSave(filename, data)); }
685 wxRect GetUpdateRegion()
const {
return m_updateRegion;}
686 const std::list<FileToSave> &GetFilesToSave()
const {
return m_filesToSave;}
687 void ClearFilesToSave () { m_filesToSave.clear();}
688 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
694 bool GetInsertAns()
const
695 {
return m_insertAns; }
697 void SetInsertAns(
bool insertAns){ m_insertAns = insertAns; }
699 bool GetOpenHCaret()
const
700 {
return m_openHCaret; }
702 void SetOpenHCaret(
bool openHCaret){ m_openHCaret = openHCaret; }
704 bool RestartOnReEvaluation()
const
705 {
return m_restartOnReEvaluation; }
707 void RestartOnReEvaluation(
bool arg){ m_restartOnReEvaluation = arg; }
711 {
return m_canvasSize; }
716 if(m_canvasSize.GetWidth() != siz.GetWidth())
723 {
return m_showBrackets; }
727 if(m_showBrackets != show)
729 return m_showBrackets = show;
734 {
return m_printBrackets; }
736 showLabels GetLabelChoice()
const
737 {
return m_showLabelChoice; }
739 bool ShowInputLabels()
const {
return m_showInputLabels;}
740 void ShowInputLabels(
bool show) {
741 if(m_showInputLabels != show)
743 m_showInputLabels = show;
746 bool InvertBackground()
const {
return m_invertBackground;}
747 void InvertBackground(
bool invert){ m_invertBackground = invert; }
749 long UndoLimit(){
return std::max(m_undoLimit,
static_cast<long>(0));}
750 void UndoLimit(
long limit){ m_undoLimit = limit; }
752 long RecentItems(){
return std::max(m_recentItems,
static_cast<long>(0));}
753 void RecentItems(
long items){ m_recentItems = items; }
757 {
return (m_showLabelChoice < labels_useronly); }
761 {
return m_showLabelChoice > labels_automatic; }
765 {
return m_showLabelChoice < labels_none; }
769 if(m_showLabelChoice != choice)
771 m_showLabelChoice = choice;
776 m_printBrackets = print;
811 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
817 {m_singlePageManual = singlePageManual;}
831 static wxString
FindProgram(
const wxString &location);
835 {
return m_fixReorderedIndices; }
841 if(m_mathJaxURL_UseUser)
844 return MathJaXURL_Auto();}
845 wxString MathJaXURL_User()
const {
return m_mathJaxURL;}
846 bool MathJaXURL_UseUser()
const {
return m_mathJaxURL_UseUser;}
847 void MathJaXURL_UseUser(
bool useUser){m_mathJaxURL_UseUser = useUser;}
849 bool EnterEvaluates()
const {
return m_enterEvaluates;}
850 void EnterEvaluates(
bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
851 static wxString MathJaXURL_Auto() {
return wxS(
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
853 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
855 bool CopyBitmap()
const {
return m_copyBitmap;}
856 void CopyBitmap(
bool copyBitmap){ m_copyBitmap = copyBitmap; }
858 bool CopyMathML()
const {
return m_copyMathML;}
859 void CopyMathML(
bool copyMathML){ m_copyMathML = copyMathML;}
860 bool CopyMathMLHTML()
const {
return m_copyMathMLHTML;}
861 void CopyMathMLHTML(
bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
862 bool HideMarkerForThisMessage(wxString message);
863 void HideMarkerForThisMessage(
const wxString &message,
bool hide)
864 {m_hideMarkerForThisMessage[message] = hide;}
865 bool CopyRTF()
const {
return m_copyRTF;}
866 void CopyRTF(
bool copyRTF) { m_copyRTF = copyRTF; }
867 bool CopySVG()
const {
return m_copySVG;}
868 void CopySVG(
bool copySVG) { m_copySVG = copySVG; }
869 bool CopyEMF()
const {
return m_copyEMF;}
870 void CopyEMF(
bool copyEMF) { m_copyEMF = copyEMF; }
871 bool UseSVG()
const {
return m_useSVG;}
872 void UseSVG(
bool useSVG) { m_useSVG = useSVG ;}
875 m_showLength = length;
884 if(m_parenthesisDrawMode != mode)
886 m_parenthesisDrawMode = mode;
889 void TocShowsSectionNumbers(
bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
891 bool TocShowsSectionNumbers()
const {
return m_TOCshowsSectionNumbers;}
893 void UseUnicodeMaths(
bool useunicodemaths)
894 { m_useUnicodeMaths = useunicodemaths; }
895 bool UseUnicodeMaths()
const {
return m_useUnicodeMaths;}
897 StringBoolHash m_hideMarkerForThisMessage;
918 long DefaultPort()
const {
return m_defaultPort;}
919 void DefaultPort(
long port){m_defaultPort = port;}
920 bool GetAbortOnError()
const {
return m_abortOnError;}
921 void SetAbortOnError(
bool abortOnError) {m_abortOnError = abortOnError;}
923 long GetLanguage()
const {
return m_language;}
924 void SetLanguage(
long language) {m_language = language;}
929 {m_maxGnuplotMegabytes = megaBytes;}
931 bool OfferKnownAnswers()
const {
return m_offerKnownAnswers;}
932 void OfferKnownAnswers(
bool offerKnownAnswers)
933 {m_offerKnownAnswers = offerKnownAnswers;}
935 wxString Documentclass()
const {
return m_documentclass;}
936 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
937 wxString DocumentclassOptions()
const {
return m_documentclassOptions;}
938 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
943 {m_htmlEquationFormat = HTMLequationFormat;}
950 void SetAutosubscript_Num(
long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
951 wxString GetAutosubscript_string()
const;
959 void ClipToDrawRegion(
bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate =
true;}
960 void SetVisibleRegion(wxRect visibleRegion){
961 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
963 m_visibleRegion = visibleRegion;
965 wxRect GetVisibleRegion()
const {
return m_visibleRegion;}
966 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
967 wxPoint GetWorksheetPosition()
const {
return m_worksheetPosition;}
968 wxString MaximaShareDir()
const {
return m_maximaShareDir;}
969 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
970 wxString MaximaDemoDir()
const {
return m_maximaDemoDir;}
971 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
972 void InLispMode(
bool lisp){m_inLispMode = lisp;}
973 bool InLispMode()
const {
return m_inLispMode;}
974 void BitmapScale(
int factor){m_bitmapScale = factor;}
975 int BitmapScale()
const {
return m_bitmapScale;}
976 void DefaultPlotHeight(
int px){m_defaultPlotHeight = px;}
977 int DefaultPlotHeight()
const {
return m_defaultPlotHeight;}
978 void DefaultPlotWidth(
int px){m_defaultPlotWidth = px;}
979 int DefaultPlotWidth()
const {
return m_defaultPlotWidth;}
980 void DefaultFramerate(
int fps){m_defaultFramerate = fps;}
981 int DefaultFramerate()
const {
return m_defaultFramerate;}
982 void TocDepth(
int depth){m_tocDepth = depth;}
983 int TocDepth()
const {
return m_tocDepth;}
984 bool TeXExponentsAfterSubscript()
const {
return m_TeXExponentsAfterSubscript;}
985 void TeXExponentsAfterSubscript(
bool ExponentsAfterSubscript)
986 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
987 bool UsePartialForDiff()
const {
return m_usePartialForDiff;}
988 void UsePartialForDiff(
bool usePartialForDiff)
989 {m_usePartialForDiff = usePartialForDiff;}
1004 bool WrapLatexMath()
const {
return m_wrapLatexMath;}
1005 void WrapLatexMath(
bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
1006 bool AllowNetworkHelp()
const {
return m_allowNetworkHelp;}
1007 void AllowNetworkHelp(
bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
1008 bool ShowAllDigits()
const {
return m_showAllDigits;}
1009 void ShowAllDigits(
bool shw){
1010 if(m_showAllDigits != shw)
1012 m_showAllDigits = shw;
1014 bool LineBreaksInLongNums()
const {
return m_lineBreaksInLongNums;}
1015 void LineBreaksInLongNums(
bool brk){
1016 if(m_lineBreaksInLongNums != brk)
1018 m_lineBreaksInLongNums = brk;
1020 int MaxClipbrdBitmapMegabytes()
const {
return m_maxClipbrd_BitmapMegabytes;}
1021 void MaxClipbrdBitmapMegabytes(
int maxClipbrd_BitmapMegabytes)
1022 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
1024 void MaximaUsesHtmlBrowser(
bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1025 bool MaximaUsesHtmlBrowser()
const {
return m_maximaUsesHhtmlBrowser;}
1026 void MaximaUsesWxmaximaBrowser(
bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1028 void ExportContainsWXMX(
bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1029 bool ExportContainsWXMX()
const {
return m_exportContainsWXMX;}
1030 void WizardTab(
long tab){m_wizardTab = tab;}
1031 long WizardTab()
const {
return m_wizardTab;}
1033 void Display2d_Unicode(
bool unicode){m_display2d_Unicode = unicode;}
1034 bool Display2d_Unicode()
const {
return m_display2d_Unicode;}
1037 bool UseWGnuplot()
const {
return m_useWgnuplot;}
1038 void UseWGnuplot(
bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1040 wxString TexPreamble()
const {
return m_texPreamble;}
1041 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1043 void SetMaximaVersion(
const wxString &version){m_maximaVersion = version;}
1044 wxString GetMaximaVersion()
const {
return m_maximaVersion;}
1045 void SetMaximaArch(
const wxString &arch){m_maximaArch = arch;}
1046 wxString GetMaximaArch()
const {
return m_maximaArch;}
1047 void SetLispVersion(
const wxString &version){m_lispVersion = version;}
1048 wxString GetLispVersion()
const {
return m_lispVersion;}
1049 void SetLispType(
const wxString &type){m_lispType = type;}
1050 wxString GetLispType()
const {
return m_lispType;}
1056 bool FontRendersChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1057 wxTextCtrl *LastActiveTextCtrl()
const {
return m_lastActiveTextCtrl; }
1058 void LastActiveTextCtrl(wxTextCtrl *last);
1066 bool StyleAffectsCode(
TextStyle style)
const;
1067 bool StyleAffectsMathOut(
TextStyle style)
const;
1068 bool StyleAffectsColorOnly(
TextStyle style)
const;
1075 maximaHelpFormat MaximaHelpFormat()
const;
1076 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1079 wxString m_maximaArch;
1080 wxString m_lispVersion;
1081 wxString m_lispType;
1082 wxString m_maximaVersion;
1104 void RecalculateForce() { m_cellCfgCnt++; }
1105 static bool UseThreads(){
return m_use_threads;}
1106 static void UseThreads(
bool use){m_use_threads = use;}
1107 static void SetMaximaLang(
const wxString &LANG){m_maxima_LANG = LANG;}
1108 static wxString GetMaximaLang(){
return m_maxima_LANG;}
1111 static wxString m_maxima_LANG;
1113 std::vector<TextStyle> m_codeStyles;
1115 std::vector<TextStyle> m_2dMathStyles;
1117 std::vector<TextStyle> m_colorOnlyStyles;
1118 std::list<FileToSave> m_filesToSave;
1119 RenderablecharsHash m_renderableChars;
1120 RenderablecharsHash m_nonRenderableChars;
1122 static bool FontDisplaysChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1124 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar,
const wxFont &font = *wxNORMAL_FONT);
1125 mathDisplayMode m_displayMode = display_2d;
1126 using CellRedrawTrace = std::vector<const Cell*>;
1127 static bool m_debugMode;
1128 bool m_showInputLabels;
1130 bool m_display2d_Unicode;
1131 bool m_usePartialForDiff;
1132 bool m_maximaUsesHhtmlBrowser;
1133 bool m_maximaUsesWxmaximaBrowser;
1135 bool m_autoSaveAsTempFile;
1139 bool m_autodetectMaxima;
1141 bool m_autodetectHelpBrowser;
1143 bool m_useInternalHelpBrowser;
1145 bool m_singlePageManual;
1147 wxRect m_updateRegion;
1149 bool m_incrementalSearch;
1151 long m_autoSubscript;
1153 wxWindow *m_workSheet = NULL;
1155 std::unique_ptr<wxClientDC> m_worksheetDC;
1170 bool m_wrapLatexMath;
1171 bool m_allowNetworkHelp;
1172 bool m_exportContainsWXMX;
1173 wxString m_texPreamble;
1176 wxString m_workingdir;
1177 bool m_TeXExponentsAfterSubscript;
1178 wxString m_helpBrowserUserLocation;
1179 wxString m_maximaUserLocation;
1181 bool m_hideBrackets;
1183 double m_printScale;
1184 double m_printMargin_Top;
1185 double m_printMargin_Bot;
1186 double m_printMargin_Left;
1187 double m_printMargin_Right;
1189 wxSize m_canvasSize;
1191 bool m_showBrackets;
1193 bool m_printBrackets;
1199 bool m_changeAsterisk;
1201 bool m_notifyIfIdle;
1203 long m_displayedDigits;
1209 bool m_showAllDigits;
1211 bool m_lineBreaksInLongNums;
1222 double m_zoomFactor;
1224 wxString m_maximaShareDir;
1225 wxString m_maximaDemoDir;
1227 bool m_clipToDrawRegion =
true;
1229 wxString m_maximaParameters;
1231 bool m_restartOnReEvaluation;
1232 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1234 long m_lineWidth_em;
1235 showLabels m_showLabelChoice;
1236 bool m_fixReorderedIndices;
1237 wxString m_mathJaxURL;
1238 bool m_mathJaxURL_UseUser;
1239 bool m_showCodeCells;
1242 bool m_copyMathMLHTML;
1247 bool m_enterEvaluates;
1253 bool m_TOCshowsSectionNumbers;
1254 bool m_useUnicodeMaths;
1256 bool m_abortOnError;
1257 bool m_showMatchingParens;
1258 bool m_hidemultiplicationsign;
1259 bool m_offerKnownAnswers;
1261 long m_maxGnuplotMegabytes;
1262 long m_defaultPlotHeight;
1263 long m_defaultPlotWidth;
1264 bool m_saveUntitled;
1266 bool m_numpadEnterEvaluates;
1267 bool m_saveImgFileName;
1275 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1276 wxString m_documentclass;
1277 wxString m_documentclassOptions;
1280 wxRect m_visibleRegion;
1282 wxPoint m_worksheetPosition;
1284 wxColour m_defaultBackgroundColor;
1286 wxBrush m_BackgroundBrush;
1287 wxBrush m_tooltipBrush;
1288 bool m_greekSidebar_ShowLatinLookalikes;
1290 bool m_useWgnuplot =
false;
1292 bool m_greekSidebar_Show_mu;
1293 wxString m_symbolPaneAdditionalChars;
1294 bool m_invertBackground;
1298 int m_defaultFramerate;
1300 int m_maxClipbrd_BitmapMegabytes;
1301 int m_autoSaveMinutes;
1302 int m_maxLayoutTime;
1303 wxString m_wxMathML_Filename;
1304 maximaHelpFormat m_maximaHelpFormat;
1305 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1306 std::atomic<std::int_fast32_t> m_cellCfgCnt{0};
1307 static bool m_use_threads;
1316 m_configuration = configuration;
1333 m_configuration = configuration;
This file declares a message dialog that sends its contents to the log message sink.
This file declares everything needed for the text style system used to style all the elements on the ...
TextStyle
All text styles known to wxMaxima.
Definition: TextStyle.h:231
@ NUMBEROFSTYLES
This is not a style, but its value tells us how many styles are defined.
Definition: TextStyle.h:272
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:97
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:142
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:648
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:664
The configuration storage for the current worksheet.
Definition: Configuration.h:86
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1555
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:299
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:820
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:1147
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:949
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:756
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:805
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1586
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:853
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:240
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1074
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:589
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:281
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:483
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:363
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:469
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1164
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1173
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:726
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1209
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:420
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:231
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:204
static const wxString & GetEscCode(const wxString &key)
Retrieve a symbol for the escape codes that can be typed after hitting the Escape key in the workshee...
Definition: Configuration.cpp:688
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:255
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:626
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:696
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:914
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1199
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1345
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:156
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:768
bool InUpdateRegion(wxRect rect) const
Whether any part of the given rectangle is within the current update region, or true if drawing is no...
Definition: Configuration.cpp:1577
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:524
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:814
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1845
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1063
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:1140
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:797
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:911
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:327
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1417
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:163
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:342
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1103
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:764
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:215
std::random_device m_rd
Our random device.
Definition: Configuration.h:1093
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:786
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:710
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:810
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:295
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:436
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:816
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:492
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1338
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:720
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:198
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:486
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:331
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:189
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:262
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:172
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:376
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:165
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:474
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:927
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:385
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:823
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:168
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:520
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1061
static const wxString CharsNeedingQuotes()
Returns a list of chars we need to escape in maxima.
Definition: Configuration.h:312
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:840
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:783
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:592
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1095
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:266
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:347
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:631
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1072
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:227
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:781
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:957
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1241
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:722
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:834
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:565
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:202
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:397
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1214
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:200
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:699
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:249
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:800
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1691
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:959
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1532
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:360
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:212
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:448
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:259
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:427
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1543
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:769
InitOpt
Definition: Configuration.h:138
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:140
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:808
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:883
drawMode
Definition: Configuration.h:132
@ ascii
Use ascii characters only.
Definition: Configuration.h:133
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:134
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:714
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:788
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1154
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:878
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:385
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1349
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:114
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:158
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:760
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1707
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1866
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:635
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:903
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:803
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:874
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:334
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1065
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:733
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1329
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1312
Text Style Definition.
Definition: TextStyle.h:63
AFontSize GetFontSize() const
The size of this style's font, asserted to be valid.
Definition: TextStyle.cpp:108
Definition: Configuration.h:412