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#define MC_LINE_SKIP Scale_Px(2)
44#define MC_TEXT_PADDING Scale_Px(1)
46#define PAREN_OPEN_TOP_UNICODE "\u239b"
47#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
48#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
49#define PAREN_CLOSE_TOP_UNICODE "\u239e"
50#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
51#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
52#define SUM_SIGN "\u2211"
53#define PROD_SIGN "\u220F"
58#define MC_HCARET_WIDTH 25
60#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
61static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
62static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
65#define LABELWIDTH_MIN 3
66#define LABELWIDTH_MAX 10
86 enum maximaHelpFormat{
98 html_export_invalidChoice
101 enum showLabels : int8_t
103 labels_automatic = 0,
104 labels_prefer_user = 1,
107 labels_invalidSelection
130 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
131 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
132 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
138 const wxEnvVariableHashMap& MaximaEnvVars()
const {
return m_maximaEnvVars;}
139 wxEnvVariableHashMap m_maximaEnvVars;
148 { m_workingdir = std::move(dir); }
152 {
return m_workingdir; }
171 void UnsetContext() {m_dc = NULL;}
194 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
195 using EscCodeIterator = EscCodeContainer::const_iterator;
198 static const wxString &
GetEscCode(
const wxString &key);
234 {
return m_hideBrackets; }
241 {
return m_printScale; }
246 void PrintMargin_Top(
double margin){m_printMargin_Top = margin;}
247 void PrintMargin_Bot(
double margin){m_printMargin_Bot = margin;}
248 void PrintMargin_Left(
double margin){m_printMargin_Left = margin;}
249 void PrintMargin_Right(
double margin){m_printMargin_Right = margin;}
250 double PrintMargin_Top()
const {
return m_printMargin_Top;}
251 double PrintMargin_Bot()
const {
return m_printMargin_Bot;}
252 double PrintMargin_Left()
const {
return m_printMargin_Left;}
253 double PrintMargin_Right()
const {
return m_printMargin_Right;}
260 if(m_zoomFactor != newzoom)
262 m_zoomFactor = newzoom;
274 {
return m_zoomFactor; }
280 void SetRecalcDC(wxDC *dc)
283 wxString GetFontName(
TextStyle ts = TS_CODE_DEFAULT)
const;
287 wxString GetSymbolFontName()
const;
289 wxFontWeight IsBold(
long st)
const;
291 wxFontStyle IsItalic(
long st)
const;
293 bool IsUnderlined(
long st)
const {
return m_styles[st].IsUnderlined();}
300 {
return m_labelWidth * 14; }
304 {
return m_labelWidth; }
308 if(m_labelWidth != labelWidth)
310 m_labelWidth = labelWidth;
328 int AutosaveMinutes()
const {
return m_autoSaveMinutes;}
329 void AutosaveMinutes(
int minutes){m_autoSaveMinutes = minutes;}
371 if(m_indent != indent)
376 bool IncrementalSearch()
const {
return m_incrementalSearch;}
379 void IncrementalSearch(
bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
384 CharsExist(
const wxString &chars,
bool exist) : chars(chars), exist(exist) {}
386 std::vector<CharsExist> m_charsInFont;
391 m_charsInFont.clear();
408 return m_lineWidth_em;
413 bool AutoSaveAsTempFile()
const {
return m_autoSaveAsTempFile;}
414 void AutoSaveAsTempFile(
bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
418 { m_lineWidth_em = width; }
425 bool SaveUntitled()
const {
return m_saveUntitled;}
426 void SaveUntitled(
bool save) {m_saveUntitled = save;}
428 bool CursorJump()
const {
return m_cursorJump;}
429 void CursorJump(
bool save){m_cursorJump = save;}
431 bool NumpadEnterEvaluates()
const {
return m_numpadEnterEvaluates;}
432 void NumpadEnterEvaluates(
bool eval){m_numpadEnterEvaluates = eval;}
434 bool SaveImgFileName()
const {
return m_saveImgFileName;}
435 void SaveImgFileName(
bool save) { m_saveImgFileName = save;}
439 {
return m_autoWrap > 0; }
456 {
return m_autoIndent; }
458 void SetAutoIndent(
bool autoIndent){m_autoIndent = autoIndent;}
463 if(m_indentMaths != indent)
465 m_indentMaths = indent;}
468 static const wxString &GetStyleName(
TextStyle textStyle);
484 void MakeStylesConsistent();
485 void Outdated(
bool outdated)
486 { m_outdated = outdated; }
490 {
return m_keepPercent; }
495 if(m_keepPercent != keepPercent)
497 m_keepPercent = keepPercent;
500 wxString GetTeXCMRI()
const
501 {
return m_fontCMRI; }
503 wxString GetTeXCMSY()
const
504 {
return m_fontCMSY; }
506 wxString GetTeXCMEX()
const
507 {
return m_fontCMEX; }
509 wxString GetTeXCMMI()
const
510 {
return m_fontCMMI; }
512 wxString GetTeXCMTI()
const
513 {
return m_fontCMTI; }
515 bool ShowCodeCells()
const
516 {
return m_showCodeCells; }
518 void ShowCodeCells(
bool show);
535 {
return m_printing; }
549 bool UsePngCairo()
const {
return m_usepngCairo;}
550 void UsePngCairo(
bool usepngCairo) { m_usepngCairo = usepngCairo;}
552 bool GetMatchParens()
const {
return m_matchParens; }
553 void SetMatchParens(
bool matchParens) { m_matchParens = matchParens; }
554 bool ShowMatchingParens()
const {
return m_showMatchingParens; }
555 void ShowMatchingParens(
bool show) { m_showMatchingParens = show; }
562 if(m_changeAsterisk != changeAsterisk)
564 m_changeAsterisk = changeAsterisk;
567 bool HidemultiplicationSign()
const {
return m_hidemultiplicationsign;}
569 void HidemultiplicationSign(
bool show) {
570 if(m_hidemultiplicationsign != show)
572 m_hidemultiplicationsign = show;
575 bool Latin2Greek()
const
576 {
return m_latin2greek;}
578 void Latin2Greek(
bool latin2greek) {
579 if(m_latin2greek != latin2greek)
581 m_latin2greek = latin2greek;
584 bool GreekSidebar_ShowLatinLookalikes()
const {
return m_greekSidebar_ShowLatinLookalikes;}
585 void GreekSidebar_ShowLatinLookalikes(
bool show){m_greekSidebar_ShowLatinLookalikes = show;}
587 bool GreekSidebar_Show_mu()
const {
return m_greekSidebar_Show_mu;}
588 void GreekSidebar_Show_mu(
bool show) {m_greekSidebar_Show_mu = show;}
590 wxString SymbolPaneAdditionalChars()
const
591 {
return m_symbolPaneAdditionalChars;}
592 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
596 {
return m_notifyIfIdle; }
598 void NotifyIfIdle(
bool notify) {m_notifyIfIdle = notify;}
605 {
return m_displayedDigits; }
607 void SetDisplayedDigits(
long displayedDigits)
609 wxASSERT_MSG(displayedDigits >= 0, _(
"Bug: Maximum number of digits that is to be displayed is too low!"));
610 if(m_displayedDigits != displayedDigits)
612 m_displayedDigits = displayedDigits;
619 FileToSave(
const wxString &filename,
const wxMemoryBuffer &data):
624 const wxString FileName()
const{
return m_filename;}
625 const wxMemoryBuffer Data()
const{
return m_data;}
627 const wxMemoryBuffer m_data;
628 const wxString m_filename;
635 TextsnippetToDraw(
const wxPoint &pos,
const wxString &text,
const wxColor &color):
641 const wxPoint Pos()
const{
return m_pos;}
642 const wxString Text()
const{
return m_text;}
643 const wxColor Color()
const{
return m_color;}
646 const wxString m_text;
647 const wxColor m_color;
651 void PushFileToSave(
const wxString &filename,
const wxMemoryBuffer &data)
652 { m_filesToSave.emplace_front(
FileToSave(filename, data)); }
654 wxRect GetUpdateRegion()
const {
return m_updateRegion;}
655 const std::list<FileToSave> &GetFilesToSave()
const {
return m_filesToSave;}
656 void ClearFilesToSave () { m_filesToSave.clear();}
657 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
663 bool GetInsertAns()
const
664 {
return m_insertAns; }
666 void SetInsertAns(
bool insertAns){ m_insertAns = insertAns; }
668 bool GetOpenHCaret()
const
669 {
return m_openHCaret; }
671 void SetOpenHCaret(
bool openHCaret){ m_openHCaret = openHCaret; }
673 bool RestartOnReEvaluation()
const
674 {
return m_restartOnReEvaluation; }
676 void RestartOnReEvaluation(
bool arg){ m_restartOnReEvaluation = arg; }
680 {
return m_canvasSize; }
685 if(m_canvasSize.GetWidth() != siz.GetWidth())
692 {
return m_showBrackets; }
696 if(m_showBrackets != show)
698 return m_showBrackets = show;
703 {
return m_printBrackets; }
705 showLabels GetLabelChoice()
const
706 {
return m_showLabelChoice; }
708 bool ShowInputLabels()
const {
return m_showInputLabels;}
709 void ShowInputLabels(
bool show) {
710 if(m_showInputLabels != show)
712 m_showInputLabels = show;
715 bool InvertBackground()
const {
return m_invertBackground;}
716 void InvertBackground(
bool invert){ m_invertBackground = invert; }
718 long UndoLimit(){
return std::max(m_undoLimit,
static_cast<long>(0));}
719 void UndoLimit(
long limit){ m_undoLimit = limit; }
721 long RecentItems(){
return std::max(m_recentItems,
static_cast<long>(0));}
722 void RecentItems(
long items){ m_recentItems = items; }
726 {
return (m_showLabelChoice < labels_useronly); }
730 {
return m_showLabelChoice > labels_automatic; }
734 {
return m_showLabelChoice < labels_none; }
738 if(m_showLabelChoice != choice)
740 m_showLabelChoice = choice;
745 m_printBrackets = print;
780 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
786 {m_singlePageManual = singlePageManual;}
800 static wxString
FindProgram(
const wxString &location);
804 {
return m_fixReorderedIndices; }
810 if(m_mathJaxURL_UseUser)
813 return MathJaXURL_Auto();}
814 wxString MathJaXURL_User()
const {
return m_mathJaxURL;}
815 bool MathJaXURL_UseUser()
const {
return m_mathJaxURL_UseUser;}
816 void MathJaXURL_UseUser(
bool useUser){m_mathJaxURL_UseUser = useUser;}
818 bool EnterEvaluates()
const {
return m_enterEvaluates;}
819 void EnterEvaluates(
bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
820 static wxString MathJaXURL_Auto() {
return wxS(
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
822 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
824 bool CopyBitmap()
const {
return m_copyBitmap;}
825 void CopyBitmap(
bool copyBitmap){ m_copyBitmap = copyBitmap; }
827 bool CopyMathML()
const {
return m_copyMathML;}
828 void CopyMathML(
bool copyMathML){ m_copyMathML = copyMathML;}
829 bool CopyMathMLHTML()
const {
return m_copyMathMLHTML;}
830 void CopyMathMLHTML(
bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
831 bool HideMarkerForThisMessage(wxString message);
832 void HideMarkerForThisMessage(
const wxString &message,
bool hide)
833 {m_hideMarkerForThisMessage[message] = hide;}
834 bool CopyRTF()
const {
return m_copyRTF;}
835 void CopyRTF(
bool copyRTF) { m_copyRTF = copyRTF; }
836 bool CopySVG()
const {
return m_copySVG;}
837 void CopySVG(
bool copySVG) { m_copySVG = copySVG; }
838 bool CopyEMF()
const {
return m_copyEMF;}
839 void CopyEMF(
bool copyEMF) { m_copyEMF = copyEMF; }
840 bool UseSVG()
const {
return m_useSVG;}
841 void UseSVG(
bool useSVG) { m_useSVG = useSVG ;}
844 m_showLength = length;
853 if(m_parenthesisDrawMode != mode)
855 m_parenthesisDrawMode = mode;
858 void TocShowsSectionNumbers(
bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
860 bool TocShowsSectionNumbers()
const {
return m_TOCshowsSectionNumbers;}
862 void UseUnicodeMaths(
bool useunicodemaths)
863 { m_useUnicodeMaths = useunicodemaths; }
864 bool UseUnicodeMaths()
const {
return m_useUnicodeMaths;}
866 StringBoolHash m_hideMarkerForThisMessage;
887 long DefaultPort()
const {
return m_defaultPort;}
888 void DefaultPort(
long port){m_defaultPort = port;}
889 bool GetAbortOnError()
const {
return m_abortOnError;}
890 void SetAbortOnError(
bool abortOnError) {m_abortOnError = abortOnError;}
892 long GetLanguage()
const {
return m_language;}
893 void SetLanguage(
long language) {m_language = language;}
898 {m_maxGnuplotMegabytes = megaBytes;}
900 bool OfferKnownAnswers()
const {
return m_offerKnownAnswers;}
901 void OfferKnownAnswers(
bool offerKnownAnswers)
902 {m_offerKnownAnswers = offerKnownAnswers;}
904 wxString Documentclass()
const {
return m_documentclass;}
905 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
906 wxString DocumentclassOptions()
const {
return m_documentclassOptions;}
907 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
912 {m_htmlEquationFormat = HTMLequationFormat;}
919 void SetAutosubscript_Num(
long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
920 wxString GetAutosubscript_string()
const;
928 void ClipToDrawRegion(
bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate =
true;}
929 void SetVisibleRegion(wxRect visibleRegion){
930 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
932 m_visibleRegion = visibleRegion;
934 wxRect GetVisibleRegion()
const {
return m_visibleRegion;}
935 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
936 wxPoint GetWorksheetPosition()
const {
return m_worksheetPosition;}
937 wxString MaximaShareDir()
const {
return m_maximaShareDir;}
938 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
939 wxString MaximaDemoDir()
const {
return m_maximaDemoDir;}
940 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
941 void InLispMode(
bool lisp){m_inLispMode = lisp;}
942 bool InLispMode()
const {
return m_inLispMode;}
943 void BitmapScale(
int factor){m_bitmapScale = factor;}
944 int BitmapScale()
const {
return m_bitmapScale;}
945 void DefaultPlotHeight(
int px){m_defaultPlotHeight = px;}
946 int DefaultPlotHeight()
const {
return m_defaultPlotHeight;}
947 void DefaultPlotWidth(
int px){m_defaultPlotWidth = px;}
948 int DefaultPlotWidth()
const {
return m_defaultPlotWidth;}
949 void DefaultFramerate(
int fps){m_defaultFramerate = fps;}
950 int DefaultFramerate()
const {
return m_defaultFramerate;}
951 void TocDepth(
int depth){m_tocDepth = depth;}
952 int TocDepth()
const {
return m_tocDepth;}
953 bool TeXExponentsAfterSubscript()
const {
return m_TeXExponentsAfterSubscript;}
954 void TeXExponentsAfterSubscript(
bool ExponentsAfterSubscript)
955 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
956 bool UsePartialForDiff()
const {
return m_usePartialForDiff;}
957 void UsePartialForDiff(
bool usePartialForDiff)
958 {m_usePartialForDiff = usePartialForDiff;}
973 bool WrapLatexMath()
const {
return m_wrapLatexMath;}
974 void WrapLatexMath(
bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
975 bool AllowNetworkHelp()
const {
return m_allowNetworkHelp;}
976 void AllowNetworkHelp(
bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
977 bool ShowAllDigits()
const {
return m_showAllDigits;}
978 void ShowAllDigits(
bool shw){
979 if(m_showAllDigits != shw)
981 m_showAllDigits = shw;
983 bool LineBreaksInLongNums()
const {
return m_lineBreaksInLongNums;}
984 void LineBreaksInLongNums(
bool brk){
985 if(m_lineBreaksInLongNums != brk)
987 m_lineBreaksInLongNums = brk;
989 int MaxClipbrdBitmapMegabytes()
const {
return m_maxClipbrd_BitmapMegabytes;}
990 void MaxClipbrdBitmapMegabytes(
int maxClipbrd_BitmapMegabytes)
991 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
993 void MaximaUsesHtmlBrowser(
bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
994 bool MaximaUsesHtmlBrowser()
const {
return m_maximaUsesHhtmlBrowser;}
995 void MaximaUsesWxmaximaBrowser(
bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
997 void ExportContainsWXMX(
bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
998 bool ExportContainsWXMX()
const {
return m_exportContainsWXMX;}
999 void WizardTab(
long tab){m_wizardTab = tab;}
1000 long WizardTab()
const {
return m_wizardTab;}
1002 void Display2d_Unicode(
bool unicode){m_display2d_Unicode = unicode;}
1003 bool Display2d_Unicode()
const {
return m_display2d_Unicode;}
1006 bool UseWGnuplot()
const {
return m_useWgnuplot;}
1007 void UseWGnuplot(
bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1009 wxString TexPreamble()
const {
return m_texPreamble;}
1010 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1012 void SetMaximaVersion(
const wxString &version){m_maximaVersion = version;}
1013 wxString GetMaximaVersion()
const {
return m_maximaVersion;}
1014 void SetMaximaArch(
const wxString &arch){m_maximaArch = arch;}
1015 wxString GetMaximaArch()
const {
return m_maximaArch;}
1016 void SetLispVersion(
const wxString &version){m_lispVersion = version;}
1017 wxString GetLispVersion()
const {
return m_lispVersion;}
1018 void SetLispType(
const wxString &type){m_lispType = type;}
1019 wxString GetLispType()
const {
return m_lispType;}
1025 bool FontRendersChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1026 wxTextCtrl *LastActiveTextCtrl()
const {
return m_lastActiveTextCtrl; }
1027 void LastActiveTextCtrl(wxTextCtrl *last);
1035 bool StyleAffectsCode(
TextStyle style)
const;
1036 bool StyleAffectsMathOut(
TextStyle style)
const;
1037 bool StyleAffectsColorOnly(
TextStyle style)
const;
1044 maximaHelpFormat MaximaHelpFormat()
const;
1045 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1048 wxString m_maximaArch;
1049 wxString m_lispVersion;
1050 wxString m_lispType;
1051 wxString m_maximaVersion;
1073 void RecalculateForce() { m_cellCfgCnt++; }
1074 static bool UseThreads(){
return m_use_threads;}
1075 static void UseThreads(
bool use){m_use_threads = use;}
1076 static void SetMaximaLang(
const wxString &LANG){m_maxima_LANG = LANG;}
1077 static wxString GetMaximaLang(){
return m_maxima_LANG;}
1080 static wxString m_maxima_LANG;
1082 std::vector<TextStyle> m_codeStyles;
1084 std::vector<TextStyle> m_2dMathStyles;
1086 std::vector<TextStyle> m_colorOnlyStyles;
1087 std::list<FileToSave> m_filesToSave;
1088 RenderablecharsHash m_renderableChars;
1089 RenderablecharsHash m_nonRenderableChars;
1091 static bool FontDisplaysChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1093 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar,
const wxFont &font = *wxNORMAL_FONT);
1094 mathDisplayMode m_displayMode = display_2d;
1095 using CellRedrawTrace = std::vector<const Cell*>;
1096 static bool m_debugMode;
1097 bool m_showInputLabels;
1099 bool m_display2d_Unicode;
1100 bool m_usePartialForDiff;
1101 bool m_maximaUsesHhtmlBrowser;
1102 bool m_maximaUsesWxmaximaBrowser;
1104 bool m_autoSaveAsTempFile;
1108 bool m_autodetectMaxima;
1110 bool m_autodetectHelpBrowser;
1112 bool m_useInternalHelpBrowser;
1114 bool m_singlePageManual;
1116 wxRect m_updateRegion;
1118 bool m_incrementalSearch;
1120 long m_autoSubscript;
1122 wxWindow *m_workSheet = NULL;
1124 std::unique_ptr<wxClientDC> m_worksheetDC;
1139 bool m_wrapLatexMath;
1140 bool m_allowNetworkHelp;
1141 bool m_exportContainsWXMX;
1142 wxString m_texPreamble;
1145 wxString m_workingdir;
1146 bool m_TeXExponentsAfterSubscript;
1147 wxString m_helpBrowserUserLocation;
1148 wxString m_maximaUserLocation;
1150 bool m_hideBrackets;
1152 double m_printScale;
1153 double m_printMargin_Top;
1154 double m_printMargin_Bot;
1155 double m_printMargin_Left;
1156 double m_printMargin_Right;
1158 wxSize m_canvasSize;
1160 bool m_showBrackets;
1162 bool m_printBrackets;
1168 bool m_changeAsterisk;
1170 bool m_notifyIfIdle;
1172 long m_displayedDigits;
1178 bool m_showAllDigits;
1180 bool m_lineBreaksInLongNums;
1191 double m_zoomFactor;
1193 wxString m_maximaShareDir;
1194 wxString m_maximaDemoDir;
1196 bool m_clipToDrawRegion =
true;
1198 wxString m_maximaParameters;
1200 bool m_restartOnReEvaluation;
1201 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1203 long m_lineWidth_em;
1204 showLabels m_showLabelChoice;
1205 bool m_fixReorderedIndices;
1206 wxString m_mathJaxURL;
1207 bool m_mathJaxURL_UseUser;
1208 bool m_showCodeCells;
1211 bool m_copyMathMLHTML;
1216 bool m_enterEvaluates;
1222 bool m_TOCshowsSectionNumbers;
1223 bool m_useUnicodeMaths;
1225 bool m_abortOnError;
1226 bool m_showMatchingParens;
1227 bool m_hidemultiplicationsign;
1228 bool m_offerKnownAnswers;
1230 long m_maxGnuplotMegabytes;
1231 long m_defaultPlotHeight;
1232 long m_defaultPlotWidth;
1233 bool m_saveUntitled;
1235 bool m_numpadEnterEvaluates;
1236 bool m_saveImgFileName;
1244 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1245 wxString m_documentclass;
1246 wxString m_documentclassOptions;
1249 wxRect m_visibleRegion;
1251 wxPoint m_worksheetPosition;
1253 wxColour m_defaultBackgroundColor;
1255 wxBrush m_BackgroundBrush;
1256 wxBrush m_tooltipBrush;
1257 bool m_greekSidebar_ShowLatinLookalikes;
1259 bool m_useWgnuplot =
false;
1261 bool m_greekSidebar_Show_mu;
1262 wxString m_symbolPaneAdditionalChars;
1263 bool m_invertBackground;
1267 int m_defaultFramerate;
1269 int m_maxClipbrd_BitmapMegabytes;
1270 int m_autoSaveMinutes;
1271 wxString m_wxMathML_Filename;
1272 maximaHelpFormat m_maximaHelpFormat;
1273 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1274 std::int_fast32_t m_cellCfgCnt = 0;
1275 static bool m_use_threads;
1284 m_configuration = configuration;
1301 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:617
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:633
The configuration storage for the current worksheet.
Definition: Configuration.h:84
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1401
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:277
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:789
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:994
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:918
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:725
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:774
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1432
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:822
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:218
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1043
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:558
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:259
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:452
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:214
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:438
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1011
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1020
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:576
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1056
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:389
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:209
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:182
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:538
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:233
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:595
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:546
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:883
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1046
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1192
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:135
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:737
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:1423
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:493
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:783
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1691
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1032
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:987
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:766
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:880
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:299
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1264
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:142
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:314
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1072
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:733
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:193
std::random_device m_rd
Our random device.
Definition: Configuration.h:1062
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:755
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:679
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:779
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:273
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:405
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:785
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:461
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1185
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:570
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:176
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:455
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:303
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:167
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:240
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:151
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:348
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:144
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:443
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:896
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:357
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:792
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:147
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:489
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1030
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:809
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:752
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:561
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1064
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:244
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:198
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:481
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1041
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:205
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:750
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:926
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1088
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:691
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:803
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:534
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:180
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:369
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1061
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:178
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:549
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1389
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:227
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:769
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1537
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:928
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1378
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:332
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:190
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:417
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:237
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:396
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:619
InitOpt
Definition: Configuration.h:117
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:119
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:777
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:852
drawMode
Definition: Configuration.h:111
@ ascii
Use ascii characters only.
Definition: Configuration.h:112
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:113
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:683
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:757
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1001
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:847
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:236
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1196
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:93
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:137
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:729
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1553
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1712
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:604
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:872
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:772
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:843
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:306
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1034
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:702
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1297
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1280
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:381