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>
41#include <wx/wupdlock.h>
43#include <wx/webview.h>
45#include <wx/msw/webview_ie.h>
49#define MC_LINE_SKIP Scale_Px(2)
50#define MC_TEXT_PADDING Scale_Px(1)
52#define PAREN_OPEN_TOP_UNICODE "\u239b"
53#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
54#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
55#define PAREN_CLOSE_TOP_UNICODE "\u239e"
56#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
57#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
58#define SUM_SIGN "\u2211"
59#define PROD_SIGN "\u220F"
64#define MC_HCARET_WIDTH 25
66#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
67static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
68static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
71#define LABELWIDTH_MIN 3
72#define LABELWIDTH_MAX 10
92 enum maximaHelpFormat{
104 html_export_invalidChoice
107 enum showLabels : int8_t
109 labels_automatic = 0,
110 labels_prefer_user = 1,
113 labels_invalidSelection
136 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
137 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
138 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
144 const wxEnvVariableHashMap& MaximaEnvVars()
const {
return m_maximaEnvVars;}
145 wxEnvVariableHashMap m_maximaEnvVars;
154 { m_workingdir = std::move(dir); }
158 {
return m_workingdir; }
177 void UnsetContext() {m_dc = NULL;}
200 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
201 using EscCodeIterator = EscCodeContainer::const_iterator;
204 static const wxString &
GetEscCode(
const wxString &key);
240 {
return m_hideBrackets; }
247 {
return m_printScale; }
252 void PrintMargin_Top(
double margin){m_printMargin_Top = margin;}
253 void PrintMargin_Bot(
double margin){m_printMargin_Bot = margin;}
254 void PrintMargin_Left(
double margin){m_printMargin_Left = margin;}
255 void PrintMargin_Right(
double margin){m_printMargin_Right = margin;}
256 double PrintMargin_Top()
const {
return m_printMargin_Top;}
257 double PrintMargin_Bot()
const {
return m_printMargin_Bot;}
258 double PrintMargin_Left()
const {
return m_printMargin_Left;}
259 double PrintMargin_Right()
const {
return m_printMargin_Right;}
266 if(m_zoomFactor != newzoom)
268 m_zoomFactor = newzoom; ;
280 {
return m_zoomFactor; }
286 void SetRecalcDC(wxDC *dc)
289 wxString GetFontName(
TextStyle ts = TS_CODE_DEFAULT)
const;
293 wxString GetSymbolFontName()
const;
295 wxFontWeight IsBold(
long st)
const;
297 wxFontStyle IsItalic(
long st)
const;
299 bool IsUnderlined(
long st)
const {
return m_styles[st].IsUnderlined();}
306 {
return m_labelWidth * 14; }
310 {
return m_labelWidth; }
314 if(m_labelWidth != labelWidth)
316 m_labelWidth = labelWidth;
334 int AutosaveMinutes()
const {
return m_autoSaveMinutes;}
335 void AutosaveMinutes(
int minutes){m_autoSaveMinutes = minutes;}
377 if(m_indent != indent)
382 bool IncrementalSearch()
const {
return m_incrementalSearch;}
385 void IncrementalSearch(
bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
390 CharsExist(
const wxString &chars,
bool exist) : chars(chars), exist(exist) {}
392 std::vector<CharsExist> m_charsInFont;
397 m_charsInFont.clear();
414 return m_lineWidth_em;
419 bool AutoSaveAsTempFile()
const {
return m_autoSaveAsTempFile;}
420 void AutoSaveAsTempFile(
bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
424 { m_lineWidth_em = width; }
431 bool SaveUntitled()
const {
return m_saveUntitled;}
432 void SaveUntitled(
bool save) {m_saveUntitled = save;}
434 bool CursorJump()
const {
return m_cursorJump;}
435 void CursorJump(
bool save){m_cursorJump = save;}
437 bool NumpadEnterEvaluates()
const {
return m_numpadEnterEvaluates;}
438 void NumpadEnterEvaluates(
bool eval){m_numpadEnterEvaluates = eval;}
440 bool SaveImgFileName()
const {
return m_saveImgFileName;}
441 void SaveImgFileName(
bool save) { m_saveImgFileName = save;}
445 {
return m_autoWrap > 0; }
462 {
return m_autoIndent; }
464 void SetAutoIndent(
bool autoIndent){m_autoIndent = autoIndent;}
469 if(m_indentMaths != indent)
471 m_indentMaths = indent;}
474 static const wxString &GetStyleName(
TextStyle textStyle);
490 void MakeStylesConsistent();
491 void Outdated(
bool outdated)
492 { m_outdated = outdated; }
496 {
return m_keepPercent; }
501 if(m_keepPercent != keepPercent)
503 m_keepPercent = keepPercent;
506 wxString GetTeXCMRI()
const
507 {
return m_fontCMRI; }
509 wxString GetTeXCMSY()
const
510 {
return m_fontCMSY; }
512 wxString GetTeXCMEX()
const
513 {
return m_fontCMEX; }
515 wxString GetTeXCMMI()
const
516 {
return m_fontCMMI; }
518 wxString GetTeXCMTI()
const
519 {
return m_fontCMTI; }
521 bool ShowCodeCells()
const
522 {
return m_showCodeCells; }
524 void ShowCodeCells(
bool show);
541 {
return m_printing; }
555 bool UsePngCairo()
const {
return m_usepngCairo;}
556 void UsePngCairo(
bool usepngCairo) { m_usepngCairo = usepngCairo;}
558 bool GetMatchParens()
const {
return m_matchParens; }
559 void SetMatchParens(
bool matchParens) { m_matchParens = matchParens; }
560 bool ShowMatchingParens()
const {
return m_showMatchingParens; }
561 void ShowMatchingParens(
bool show) { m_showMatchingParens = show; }
568 if(m_changeAsterisk != changeAsterisk)
570 m_changeAsterisk = changeAsterisk;
573 bool HidemultiplicationSign()
const {
return m_hidemultiplicationsign;}
575 void HidemultiplicationSign(
bool show) {
576 if(m_hidemultiplicationsign != show)
578 m_hidemultiplicationsign = show;
581 bool Latin2Greek()
const
582 {
return m_latin2greek;}
584 void Latin2Greek(
bool latin2greek) {
585 if(m_latin2greek != latin2greek)
587 m_latin2greek = latin2greek;
590 bool GreekSidebar_ShowLatinLookalikes()
const {
return m_greekSidebar_ShowLatinLookalikes;}
591 void GreekSidebar_ShowLatinLookalikes(
bool show){m_greekSidebar_ShowLatinLookalikes = show;}
593 bool GreekSidebar_Show_mu()
const {
return m_greekSidebar_Show_mu;}
594 void GreekSidebar_Show_mu(
bool show) {m_greekSidebar_Show_mu = show;}
596 wxString SymbolPaneAdditionalChars()
const
597 {
return m_symbolPaneAdditionalChars;}
598 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
602 {
return m_notifyIfIdle; }
604 void NotifyIfIdle(
bool notify) {m_notifyIfIdle = notify;}
611 {
return m_displayedDigits; }
613 void SetDisplayedDigits(
long displayedDigits)
615 wxASSERT_MSG(displayedDigits >= 0, _(
"Bug: Maximum number of digits that is to be displayed is too low!"));
616 if(m_displayedDigits != displayedDigits)
618 m_displayedDigits = displayedDigits;
625 FileToSave(
const wxString &filename,
const wxMemoryBuffer &data):
630 const wxString FileName()
const{
return m_filename;}
631 const wxMemoryBuffer Data()
const{
return m_data;}
633 const wxMemoryBuffer m_data;
634 const wxString m_filename;
641 TextsnippetToDraw(
const wxPoint &pos,
const wxString &text,
const wxColor &color):
647 const wxPoint Pos()
const{
return m_pos;}
648 const wxString Text()
const{
return m_text;}
649 const wxColor Color()
const{
return m_color;}
652 const wxString m_text;
653 const wxColor m_color;
657 void PushFileToSave(
const wxString &filename,
const wxMemoryBuffer &data)
658 { m_filesToSave.emplace_front(
FileToSave(filename, data)); }
660 wxRect GetUpdateRegion()
const {
return m_updateRegion;}
661 const std::list<FileToSave> &GetFilesToSave()
const {
return m_filesToSave;}
662 void ClearFilesToSave () { m_filesToSave.clear();}
663 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
669 bool GetInsertAns()
const
670 {
return m_insertAns; }
672 void SetInsertAns(
bool insertAns){ m_insertAns = insertAns; }
674 bool GetOpenHCaret()
const
675 {
return m_openHCaret; }
677 void SetOpenHCaret(
bool openHCaret){ m_openHCaret = openHCaret; }
679 bool RestartOnReEvaluation()
const
680 {
return m_restartOnReEvaluation; }
682 void RestartOnReEvaluation(
bool arg){ m_restartOnReEvaluation = arg; }
686 {
return m_canvasSize; }
691 if(m_canvasSize.GetWidth() != siz.GetWidth())
698 {
return m_showBrackets; }
702 if(m_showBrackets != show)
704 return m_showBrackets = show;
709 {
return m_printBrackets; }
711 showLabels GetLabelChoice()
const
712 {
return m_showLabelChoice; }
714 bool ShowInputLabels()
const {
return m_showInputLabels;}
715 void ShowInputLabels(
bool show) {
716 if(m_showInputLabels != show)
718 m_showInputLabels = show;
721 bool InvertBackground()
const {
return m_invertBackground;}
722 void InvertBackground(
bool invert){ m_invertBackground = invert; }
724 long UndoLimit(){
return std::max(m_undoLimit,
static_cast<long>(0));}
725 void UndoLimit(
long limit){ m_undoLimit = limit; }
727 long RecentItems(){
return std::max(m_recentItems,
static_cast<long>(0));}
728 void RecentItems(
long items){ m_recentItems = items; }
732 {
return (m_showLabelChoice < labels_useronly); }
736 {
return m_showLabelChoice > labels_automatic; }
740 {
return m_showLabelChoice < labels_none; }
744 if(m_showLabelChoice != choice)
746 m_showLabelChoice = choice;
751 m_printBrackets = print;
786 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
792 {m_singlePageManual = singlePageManual;}
806 static wxString
FindProgram(
const wxString &location);
810 {
return m_fixReorderedIndices; }
816 if(m_mathJaxURL_UseUser)
819 return MathJaXURL_Auto();}
820 wxString MathJaXURL_User()
const {
return m_mathJaxURL;}
821 bool MathJaXURL_UseUser()
const {
return m_mathJaxURL_UseUser;}
822 void MathJaXURL_UseUser(
bool useUser){m_mathJaxURL_UseUser = useUser;}
824 bool EnterEvaluates()
const {
return m_enterEvaluates;}
825 void EnterEvaluates(
bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
826 static wxString MathJaXURL_Auto() {
return wxS(
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
828 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
830 bool CopyBitmap()
const {
return m_copyBitmap;}
831 void CopyBitmap(
bool copyBitmap){ m_copyBitmap = copyBitmap; }
833 bool CopyMathML()
const {
return m_copyMathML;}
834 void CopyMathML(
bool copyMathML){ m_copyMathML = copyMathML;}
835 bool CopyMathMLHTML()
const {
return m_copyMathMLHTML;}
836 void CopyMathMLHTML(
bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
837 bool HideMarkerForThisMessage(wxString message);
838 void HideMarkerForThisMessage(
const wxString &message,
bool hide)
839 {m_hideMarkerForThisMessage[message] = hide;}
840 bool CopyRTF()
const {
return m_copyRTF;}
841 void CopyRTF(
bool copyRTF) { m_copyRTF = copyRTF; }
842 bool CopySVG()
const {
return m_copySVG;}
843 void CopySVG(
bool copySVG) { m_copySVG = copySVG; }
844 bool CopyEMF()
const {
return m_copyEMF;}
845 void CopyEMF(
bool copyEMF) { m_copyEMF = copyEMF; }
846 bool UseSVG()
const {
return m_useSVG;}
847 void UseSVG(
bool useSVG) { m_useSVG = useSVG ;}
850 m_showLength = length;
859 if(m_parenthesisDrawMode != mode)
861 m_parenthesisDrawMode = mode;
864 void TocShowsSectionNumbers(
bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
866 bool TocShowsSectionNumbers()
const {
return m_TOCshowsSectionNumbers;}
868 void UseUnicodeMaths(
bool useunicodemaths)
869 { m_useUnicodeMaths = useunicodemaths; }
870 bool UseUnicodeMaths()
const {
return m_useUnicodeMaths;}
872 StringBoolHash m_hideMarkerForThisMessage;
893 long DefaultPort()
const {
return m_defaultPort;}
894 void DefaultPort(
long port){m_defaultPort = port;}
895 bool GetAbortOnError()
const {
return m_abortOnError;}
896 void SetAbortOnError(
bool abortOnError) {m_abortOnError = abortOnError;}
898 long GetLanguage()
const {
return m_language;}
899 void SetLanguage(
long language) {m_language = language;}
904 {m_maxGnuplotMegabytes = megaBytes;}
906 bool OfferKnownAnswers()
const {
return m_offerKnownAnswers;}
907 void OfferKnownAnswers(
bool offerKnownAnswers)
908 {m_offerKnownAnswers = offerKnownAnswers;}
910 wxString Documentclass()
const {
return m_documentclass;}
911 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
912 wxString DocumentclassOptions()
const {
return m_documentclassOptions;}
913 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
918 {m_htmlEquationFormat = HTMLequationFormat;}
925 void SetAutosubscript_Num(
long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
926 wxString GetAutosubscript_string()
const;
934 void ClipToDrawRegion(
bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate =
true;}
935 void SetVisibleRegion(wxRect visibleRegion){
936 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
938 m_visibleRegion = visibleRegion;
940 wxRect GetVisibleRegion()
const {
return m_visibleRegion;}
941 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
942 wxPoint GetWorksheetPosition()
const {
return m_worksheetPosition;}
943 wxString MaximaShareDir()
const {
return m_maximaShareDir;}
944 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
945 wxString MaximaDemoDir()
const {
return m_maximaDemoDir;}
946 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
947 void InLispMode(
bool lisp){m_inLispMode = lisp;}
948 bool InLispMode()
const {
return m_inLispMode;}
949 void BitmapScale(
int factor){m_bitmapScale = factor;}
950 int BitmapScale()
const {
return m_bitmapScale;}
951 void DefaultPlotHeight(
int px){m_defaultPlotHeight = px;}
952 int DefaultPlotHeight()
const {
return m_defaultPlotHeight;}
953 void DefaultPlotWidth(
int px){m_defaultPlotWidth = px;}
954 int DefaultPlotWidth()
const {
return m_defaultPlotWidth;}
955 void DefaultFramerate(
int fps){m_defaultFramerate = fps;}
956 int DefaultFramerate()
const {
return m_defaultFramerate;}
957 void TocDepth(
int depth){m_tocDepth = depth;}
958 int TocDepth()
const {
return m_tocDepth;}
959 bool TeXExponentsAfterSubscript()
const {
return m_TeXExponentsAfterSubscript;}
960 void TeXExponentsAfterSubscript(
bool ExponentsAfterSubscript)
961 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
962 bool UsePartialForDiff()
const {
return m_usePartialForDiff;}
963 void UsePartialForDiff(
bool usePartialForDiff)
964 {m_usePartialForDiff = usePartialForDiff;}
979 bool WrapLatexMath()
const {
return m_wrapLatexMath;}
980 void WrapLatexMath(
bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
981 bool AllowNetworkHelp()
const {
return m_allowNetworkHelp;}
982 void AllowNetworkHelp(
bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
983 bool ShowAllDigits()
const {
return m_showAllDigits;}
984 void ShowAllDigits(
bool shw){
985 if(m_showAllDigits != shw)
987 m_showAllDigits = shw;
989 bool LineBreaksInLongNums()
const {
return m_lineBreaksInLongNums;}
990 void LineBreaksInLongNums(
bool brk){
991 if(m_lineBreaksInLongNums != brk)
993 m_lineBreaksInLongNums = brk;
995 int MaxClipbrdBitmapMegabytes()
const {
return m_maxClipbrd_BitmapMegabytes;}
996 void MaxClipbrdBitmapMegabytes(
int maxClipbrd_BitmapMegabytes)
997 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
999 void MaximaUsesHtmlBrowser(
bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1000 bool MaximaUsesHtmlBrowser()
const {
return m_maximaUsesHhtmlBrowser;}
1001 void MaximaUsesWxmaximaBrowser(
bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1003 void ExportContainsWXMX(
bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1004 bool ExportContainsWXMX()
const {
return m_exportContainsWXMX;}
1005 void WizardTab(
long tab){m_wizardTab = tab;}
1006 long WizardTab()
const {
return m_wizardTab;}
1008 void Display2d_Unicode(
bool unicode){m_display2d_Unicode = unicode;}
1009 bool Display2d_Unicode()
const {
return m_display2d_Unicode;}
1012 bool UseWGnuplot()
const {
return m_useWgnuplot;}
1013 void UseWGnuplot(
bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1015 wxString TexPreamble()
const {
return m_texPreamble;}
1016 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1018 void SetMaximaVersion(
const wxString &version){m_maximaVersion = version;}
1019 wxString GetMaximaVersion()
const {
return m_maximaVersion;}
1020 void SetMaximaArch(
const wxString &arch){m_maximaArch = arch;}
1021 wxString GetMaximaArch()
const {
return m_maximaArch;}
1022 void SetLispVersion(
const wxString &version){m_lispVersion = version;}
1023 wxString GetLispVersion()
const {
return m_lispVersion;}
1024 void SetLispType(
const wxString &type){m_lispType = type;}
1025 wxString GetLispType()
const {
return m_lispType;}
1031 bool FontRendersChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1032 wxTextCtrl *LastActiveTextCtrl()
const {
return m_lastActiveTextCtrl; }
1033 void LastActiveTextCtrl(wxTextCtrl *last);
1041 bool StyleAffectsCode(
TextStyle style)
const;
1042 bool StyleAffectsMathOut(
TextStyle style)
const;
1043 bool StyleAffectsColorOnly(
TextStyle style)
const;
1050 maximaHelpFormat MaximaHelpFormat()
const;
1051 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1054 wxString m_maximaArch;
1055 wxString m_lispVersion;
1056 wxString m_lispType;
1057 wxString m_maximaVersion;
1079 void RecalculateForce() { m_cellCfgCnt++; }
1080 static bool UseThreads(){
return m_use_threads;}
1081 static void UseThreads(
bool use){m_use_threads = use;}
1082 static void SetMaximaLang(
const wxString &LANG){m_maxima_LANG = LANG;}
1083 static wxString GetMaximaLang(){
return m_maxima_LANG;}
1086 static wxString m_maxima_LANG;
1088 std::vector<TextStyle> m_codeStyles;
1090 std::vector<TextStyle> m_2dMathStyles;
1092 std::vector<TextStyle> m_colorOnlyStyles;
1093 std::list<FileToSave> m_filesToSave;
1094 RenderablecharsHash m_renderableChars;
1095 RenderablecharsHash m_nonRenderableChars;
1097 static bool FontDisplaysChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1099 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar,
const wxFont &font = *wxNORMAL_FONT);
1100 mathDisplayMode m_displayMode = display_2d;
1101 using CellRedrawTrace = std::vector<const Cell*>;
1102 static bool m_debugMode;
1103 bool m_showInputLabels;
1105 bool m_display2d_Unicode;
1106 bool m_usePartialForDiff;
1107 bool m_maximaUsesHhtmlBrowser;
1108 bool m_maximaUsesWxmaximaBrowser;
1110 bool m_autoSaveAsTempFile;
1114 bool m_autodetectMaxima;
1116 bool m_autodetectHelpBrowser;
1118 bool m_useInternalHelpBrowser;
1120 bool m_singlePageManual;
1122 wxRect m_updateRegion;
1124 bool m_incrementalSearch;
1126 long m_autoSubscript;
1128 wxWindow *m_workSheet = NULL;
1130 std::unique_ptr<wxClientDC> m_worksheetDC;
1145 bool m_wrapLatexMath;
1146 bool m_allowNetworkHelp;
1147 bool m_exportContainsWXMX;
1148 wxString m_texPreamble;
1151 wxString m_workingdir;
1152 bool m_TeXExponentsAfterSubscript;
1153 wxString m_helpBrowserUserLocation;
1154 wxString m_maximaUserLocation;
1156 bool m_hideBrackets;
1158 double m_printScale;
1159 double m_printMargin_Top;
1160 double m_printMargin_Bot;
1161 double m_printMargin_Left;
1162 double m_printMargin_Right;
1164 wxSize m_canvasSize;
1166 bool m_showBrackets;
1168 bool m_printBrackets;
1174 bool m_changeAsterisk;
1176 bool m_notifyIfIdle;
1178 long m_displayedDigits;
1184 bool m_showAllDigits;
1186 bool m_lineBreaksInLongNums;
1197 double m_zoomFactor;
1199 wxString m_maximaShareDir;
1200 wxString m_maximaDemoDir;
1202 bool m_clipToDrawRegion =
true;
1204 wxString m_maximaParameters;
1206 bool m_restartOnReEvaluation;
1207 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1209 long m_lineWidth_em;
1210 showLabels m_showLabelChoice;
1211 bool m_fixReorderedIndices;
1212 wxString m_mathJaxURL;
1213 bool m_mathJaxURL_UseUser;
1214 bool m_showCodeCells;
1217 bool m_copyMathMLHTML;
1222 bool m_enterEvaluates;
1228 bool m_TOCshowsSectionNumbers;
1229 bool m_useUnicodeMaths;
1231 bool m_abortOnError;
1232 bool m_showMatchingParens;
1233 bool m_hidemultiplicationsign;
1234 bool m_offerKnownAnswers;
1236 long m_maxGnuplotMegabytes;
1237 long m_defaultPlotHeight;
1238 long m_defaultPlotWidth;
1239 bool m_saveUntitled;
1241 bool m_numpadEnterEvaluates;
1242 bool m_saveImgFileName;
1250 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1251 wxString m_documentclass;
1252 wxString m_documentclassOptions;
1255 wxRect m_visibleRegion;
1257 wxPoint m_worksheetPosition;
1259 wxColour m_defaultBackgroundColor;
1261 wxBrush m_BackgroundBrush;
1262 wxBrush m_tooltipBrush;
1263 bool m_greekSidebar_ShowLatinLookalikes;
1265 bool m_useWgnuplot =
false;
1267 bool m_greekSidebar_Show_mu;
1268 wxString m_symbolPaneAdditionalChars;
1269 bool m_invertBackground;
1273 int m_defaultFramerate;
1275 int m_maxClipbrd_BitmapMegabytes;
1276 int m_autoSaveMinutes;
1277 wxString m_wxMathML_Filename;
1278 maximaHelpFormat m_maximaHelpFormat;
1279 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1280 std::int_fast32_t m_cellCfgCnt = 0;
1281 static bool m_use_threads;
1290 m_configuration = configuration;
1307 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:98
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:623
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:639
The configuration storage for the current worksheet.
Definition: Configuration.h:90
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1406
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:283
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:795
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:999
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:924
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:731
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:780
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1437
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:828
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:224
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1049
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:564
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:265
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:458
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:219
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:444
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1016
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1025
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:581
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1061
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:395
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:215
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:188
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:543
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:239
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:601
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:551
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:889
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1051
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1197
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:141
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:743
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:1428
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:499
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:789
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1696
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1038
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:992
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:772
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:886
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:305
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1269
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:148
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:320
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1078
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:739
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:199
std::random_device m_rd
Our random device.
Definition: Configuration.h:1068
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:761
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:685
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:785
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:279
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:411
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:791
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:467
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1190
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:575
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:182
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:461
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:309
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:173
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:246
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:157
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:354
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:150
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:449
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:902
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:363
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:798
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:153
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:495
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1036
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:815
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:758
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:567
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1070
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:250
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:203
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:486
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1047
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:211
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:756
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:932
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1093
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:697
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:809
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:540
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:186
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:375
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1066
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:184
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:554
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1394
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:233
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:775
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1542
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:934
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1383
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:338
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:196
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:423
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:243
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:402
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:624
InitOpt
Definition: Configuration.h:123
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:125
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:783
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:858
drawMode
Definition: Configuration.h:117
@ ascii
Use ascii characters only.
Definition: Configuration.h:118
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:119
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:689
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:763
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1006
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:853
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:241
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1201
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:99
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:143
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:735
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1558
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1717
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:610
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:878
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:778
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:849
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:312
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1040
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:708
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1303
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1286
Text Style Definition.
Definition: TextStyle.h:63
AFontSize GetFontSize() const
The size of this style's font, asserted to be valid.
Definition: TextStyle.cpp:101
Definition: Configuration.h:387