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>
42#include <wx/webview.h>
44#include <wx/msw/webview_ie.h>
47#define MC_LINE_SKIP Scale_Px(2)
48#define MC_TEXT_PADDING Scale_Px(1)
50#define PAREN_OPEN_TOP_UNICODE "\u239b"
51#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
52#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
53#define PAREN_CLOSE_TOP_UNICODE "\u239e"
54#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
55#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
56#define SUM_SIGN "\u2211"
57#define PROD_SIGN "\u220F"
62#define MC_HCARET_WIDTH 25
64#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
65static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
66static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
87 enum maximaHelpFormat{
99 html_export_invalidChoice
102 enum showLabels : int8_t
104 labels_automatic = 0,
105 labels_prefer_user = 1,
108 labels_invalidSelection
131 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
132 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
133 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
139 const wxEnvVariableHashMap& MaximaEnvVars()
const {
return m_maximaEnvVars;}
140 wxEnvVariableHashMap m_maximaEnvVars;
149 { m_workingdir = std::move(dir); }
153 {
return m_workingdir; }
172 void UnsetContext() {m_dc = NULL;}
195 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
196 using EscCodeIterator = EscCodeContainer::const_iterator;
199 static const wxString &
GetEscCode(
const wxString &key);
235 {
return m_hideBrackets; }
242 {
return m_printScale; }
247 void PrintMargin_Top(
double margin){m_printMargin_Top = margin;}
248 void PrintMargin_Bot(
double margin){m_printMargin_Bot = margin;}
249 void PrintMargin_Left(
double margin){m_printMargin_Left = margin;}
250 void PrintMargin_Right(
double margin){m_printMargin_Right = margin;}
251 double PrintMargin_Top()
const {
return m_printMargin_Top;}
252 double PrintMargin_Bot()
const {
return m_printMargin_Bot;}
253 double PrintMargin_Left()
const {
return m_printMargin_Left;}
254 double PrintMargin_Right()
const {
return m_printMargin_Right;}
261 if(m_zoomFactor != newzoom)
263 m_zoomFactor = newzoom; ;
275 {
return m_zoomFactor; }
281 void SetRecalcDC(wxDC *dc)
284 wxString GetFontName(
TextStyle ts = TS_CODE_DEFAULT)
const;
288 wxString GetSymbolFontName()
const;
290 wxFontWeight IsBold(
long st)
const;
292 wxFontStyle IsItalic(
long st)
const;
294 bool IsUnderlined(
long st)
const {
return m_styles[st].IsUnderlined();}
301 {
return m_labelWidth * 14; }
305 {
return m_labelWidth; }
309 if(m_labelWidth != labelWidth)
311 m_labelWidth = labelWidth;
329 int AutosaveMinutes()
const {
return m_autoSaveMinutes;}
330 void AutosaveMinutes(
int minutes){m_autoSaveMinutes = minutes;}
372 if(m_indent != indent)
377 bool IncrementalSearch()
const {
return m_incrementalSearch;}
380 void IncrementalSearch(
bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
385 CharsExist(
const wxString &chars,
bool exist) : chars(chars), exist(exist) {}
387 std::vector<CharsExist> m_charsInFont;
392 m_charsInFont.clear();
409 return m_lineWidth_em;
414 bool AutoSaveAsTempFile()
const {
return m_autoSaveAsTempFile;}
415 void AutoSaveAsTempFile(
bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
419 { m_lineWidth_em = width; }
426 bool SaveUntitled()
const {
return m_saveUntitled;}
427 void SaveUntitled(
bool save) {m_saveUntitled = save;}
429 bool CursorJump()
const {
return m_cursorJump;}
430 void CursorJump(
bool save){m_cursorJump = save;}
432 bool NumpadEnterEvaluates()
const {
return m_numpadEnterEvaluates;}
433 void NumpadEnterEvaluates(
bool eval){m_numpadEnterEvaluates = eval;}
435 bool SaveImgFileName()
const {
return m_saveImgFileName;}
436 void SaveImgFileName(
bool save) { m_saveImgFileName = save;}
440 {
return m_autoWrap > 0; }
457 {
return m_autoIndent; }
459 void SetAutoIndent(
bool autoIndent){m_autoIndent = autoIndent;}
464 if(m_indentMaths != indent)
466 m_indentMaths = indent;}
469 static const wxString &GetStyleName(
TextStyle textStyle);
485 void MakeStylesConsistent();
486 void Outdated(
bool outdated)
487 { m_outdated = outdated; }
491 {
return m_keepPercent; }
496 if(m_keepPercent != keepPercent)
498 m_keepPercent = keepPercent;
501 wxString GetTeXCMRI()
const
502 {
return m_fontCMRI; }
504 wxString GetTeXCMSY()
const
505 {
return m_fontCMSY; }
507 wxString GetTeXCMEX()
const
508 {
return m_fontCMEX; }
510 wxString GetTeXCMMI()
const
511 {
return m_fontCMMI; }
513 wxString GetTeXCMTI()
const
514 {
return m_fontCMTI; }
516 bool ShowCodeCells()
const
517 {
return m_showCodeCells; }
519 void ShowCodeCells(
bool show);
536 {
return m_printing; }
550 bool UsePngCairo()
const {
return m_usepngCairo;}
551 void UsePngCairo(
bool usepngCairo) { m_usepngCairo = usepngCairo;}
553 bool GetMatchParens()
const {
return m_matchParens; }
554 void SetMatchParens(
bool matchParens) { m_matchParens = matchParens; }
555 bool ShowMatchingParens()
const {
return m_showMatchingParens; }
556 void ShowMatchingParens(
bool show) { m_showMatchingParens = show; }
563 if(m_changeAsterisk != changeAsterisk)
565 m_changeAsterisk = changeAsterisk;
568 bool HidemultiplicationSign()
const {
return m_hidemultiplicationsign;}
570 void HidemultiplicationSign(
bool show) {
571 if(m_hidemultiplicationsign != show)
573 m_hidemultiplicationsign = show;
576 bool Latin2Greek()
const
577 {
return m_latin2greek;}
579 void Latin2Greek(
bool latin2greek) {
580 if(m_latin2greek != latin2greek)
582 m_latin2greek = latin2greek;
585 bool GreekSidebar_ShowLatinLookalikes()
const {
return m_greekSidebar_ShowLatinLookalikes;}
586 void GreekSidebar_ShowLatinLookalikes(
bool show){m_greekSidebar_ShowLatinLookalikes = show;}
588 bool GreekSidebar_Show_mu()
const {
return m_greekSidebar_Show_mu;}
589 void GreekSidebar_Show_mu(
bool show) {m_greekSidebar_Show_mu = show;}
591 wxString SymbolPaneAdditionalChars()
const
592 {
return m_symbolPaneAdditionalChars;}
593 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
597 {
return m_notifyIfIdle; }
599 void NotifyIfIdle(
bool notify) {m_notifyIfIdle = notify;}
606 {
return m_displayedDigits; }
608 void SetDisplayedDigits(
long displayedDigits)
610 wxASSERT_MSG(displayedDigits >= 0, _(
"Bug: Maximum number of digits that is to be displayed is too low!"));
611 if(m_displayedDigits != displayedDigits)
613 m_displayedDigits = displayedDigits;
620 FileToSave(
const wxString &filename,
const wxMemoryBuffer &data):
625 const wxString FileName()
const{
return m_filename;}
626 const wxMemoryBuffer Data()
const{
return m_data;}
628 const wxMemoryBuffer m_data;
629 const wxString m_filename;
636 TextsnippetToDraw(
const wxPoint &pos,
const wxString &text,
const wxColor &color):
642 const wxPoint Pos()
const{
return m_pos;}
643 const wxString Text()
const{
return m_text;}
644 const wxColor Color()
const{
return m_color;}
647 const wxString m_text;
648 const wxColor m_color;
652 void PushFileToSave(
const wxString &filename,
const wxMemoryBuffer &data)
653 { m_filesToSave.emplace_front(
FileToSave(filename, data)); }
655 wxRect GetUpdateRegion()
const {
return m_updateRegion;}
656 const std::list<FileToSave> &GetFilesToSave()
const {
return m_filesToSave;}
657 void ClearFilesToSave () { m_filesToSave.clear();}
658 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
664 bool GetInsertAns()
const
665 {
return m_insertAns; }
667 void SetInsertAns(
bool insertAns){ m_insertAns = insertAns; }
669 bool GetOpenHCaret()
const
670 {
return m_openHCaret; }
672 void SetOpenHCaret(
bool openHCaret){ m_openHCaret = openHCaret; }
674 bool RestartOnReEvaluation()
const
675 {
return m_restartOnReEvaluation; }
677 void RestartOnReEvaluation(
bool arg){ m_restartOnReEvaluation = arg; }
681 {
return m_canvasSize; }
686 if(m_canvasSize.GetWidth() != siz.GetWidth())
693 {
return m_showBrackets; }
697 if(m_showBrackets != show)
699 return m_showBrackets = show;
704 {
return m_printBrackets; }
706 showLabels GetLabelChoice()
const
707 {
return m_showLabelChoice; }
709 bool ShowInputLabels()
const {
return m_showInputLabels;}
710 void ShowInputLabels(
bool show) {
711 if(m_showInputLabels != show)
713 m_showInputLabels = show;
716 bool InvertBackground()
const {
return m_invertBackground;}
717 void InvertBackground(
bool invert){ m_invertBackground = invert; }
719 long UndoLimit(){
return std::max(m_undoLimit,
static_cast<long>(0));}
720 void UndoLimit(
long limit){ m_undoLimit = limit; }
722 long RecentItems(){
return std::max(m_recentItems,
static_cast<long>(0));}
723 void RecentItems(
long items){ m_recentItems = items; }
727 {
return (m_showLabelChoice < labels_useronly); }
731 {
return m_showLabelChoice > labels_automatic; }
735 {
return m_showLabelChoice < labels_none; }
739 if(m_showLabelChoice != choice)
741 m_showLabelChoice = choice;
746 m_printBrackets = print;
781 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
787 {m_singlePageManual = singlePageManual;}
801 static wxString
FindProgram(
const wxString &location);
805 {
return m_fixReorderedIndices; }
811 if(m_mathJaxURL_UseUser)
814 return MathJaXURL_Auto();}
815 wxString MathJaXURL_User()
const {
return m_mathJaxURL;}
816 bool MathJaXURL_UseUser()
const {
return m_mathJaxURL_UseUser;}
817 void MathJaXURL_UseUser(
bool useUser){m_mathJaxURL_UseUser = useUser;}
819 bool EnterEvaluates()
const {
return m_enterEvaluates;}
820 void EnterEvaluates(
bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
821 static wxString MathJaXURL_Auto() {
return wxS(
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
823 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
825 bool CopyBitmap()
const {
return m_copyBitmap;}
826 void CopyBitmap(
bool copyBitmap){ m_copyBitmap = copyBitmap; }
828 bool CopyMathML()
const {
return m_copyMathML;}
829 void CopyMathML(
bool copyMathML){ m_copyMathML = copyMathML;}
830 bool CopyMathMLHTML()
const {
return m_copyMathMLHTML;}
831 void CopyMathMLHTML(
bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
832 bool HideMarkerForThisMessage(wxString message);
833 void HideMarkerForThisMessage(
const wxString &message,
bool hide)
834 {m_hideMarkerForThisMessage[message] = hide;}
835 bool CopyRTF()
const {
return m_copyRTF;}
836 void CopyRTF(
bool copyRTF) { m_copyRTF = copyRTF; }
837 bool CopySVG()
const {
return m_copySVG;}
838 void CopySVG(
bool copySVG) { m_copySVG = copySVG; }
839 bool CopyEMF()
const {
return m_copyEMF;}
840 void CopyEMF(
bool copyEMF) { m_copyEMF = copyEMF; }
841 bool UseSVG()
const {
return m_useSVG;}
842 void UseSVG(
bool useSVG) { m_useSVG = useSVG ;}
845 m_showLength = length;
854 if(m_parenthesisDrawMode != mode)
856 m_parenthesisDrawMode = mode;
859 void TocShowsSectionNumbers(
bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
861 bool TocShowsSectionNumbers()
const {
return m_TOCshowsSectionNumbers;}
863 void UseUnicodeMaths(
bool useunicodemaths)
864 { m_useUnicodeMaths = useunicodemaths; }
865 bool UseUnicodeMaths()
const {
return m_useUnicodeMaths;}
867 StringBoolHash m_hideMarkerForThisMessage;
888 long DefaultPort()
const {
return m_defaultPort;}
889 void DefaultPort(
long port){m_defaultPort = port;}
890 bool GetAbortOnError()
const {
return m_abortOnError;}
891 void SetAbortOnError(
bool abortOnError) {m_abortOnError = abortOnError;}
893 long GetLanguage()
const {
return m_language;}
894 void SetLanguage(
long language) {m_language = language;}
899 {m_maxGnuplotMegabytes = megaBytes;}
901 bool OfferKnownAnswers()
const {
return m_offerKnownAnswers;}
902 void OfferKnownAnswers(
bool offerKnownAnswers)
903 {m_offerKnownAnswers = offerKnownAnswers;}
905 wxString Documentclass()
const {
return m_documentclass;}
906 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
907 wxString DocumentclassOptions()
const {
return m_documentclassOptions;}
908 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
913 {m_htmlEquationFormat = HTMLequationFormat;}
920 void SetAutosubscript_Num(
long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
921 wxString GetAutosubscript_string()
const;
929 void ClipToDrawRegion(
bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate =
true;}
930 void SetVisibleRegion(wxRect visibleRegion){
931 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
933 m_visibleRegion = visibleRegion;
935 wxRect GetVisibleRegion()
const {
return m_visibleRegion;}
936 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
937 wxPoint GetWorksheetPosition()
const {
return m_worksheetPosition;}
938 wxString MaximaShareDir()
const {
return m_maximaShareDir;}
939 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
940 wxString MaximaDemoDir()
const {
return m_maximaDemoDir;}
941 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
942 void InLispMode(
bool lisp){m_inLispMode = lisp;}
943 bool InLispMode()
const {
return m_inLispMode;}
944 void BitmapScale(
int factor){m_bitmapScale = factor;}
945 int BitmapScale()
const {
return m_bitmapScale;}
946 void DefaultPlotHeight(
int px){m_defaultPlotHeight = px;}
947 int DefaultPlotHeight()
const {
return m_defaultPlotHeight;}
948 void DefaultPlotWidth(
int px){m_defaultPlotWidth = px;}
949 int DefaultPlotWidth()
const {
return m_defaultPlotWidth;}
950 void DefaultFramerate(
int fps){m_defaultFramerate = fps;}
951 int DefaultFramerate()
const {
return m_defaultFramerate;}
952 void TocDepth(
int depth){m_tocDepth = depth;}
953 int TocDepth()
const {
return m_tocDepth;}
954 bool TeXExponentsAfterSubscript()
const {
return m_TeXExponentsAfterSubscript;}
955 void TeXExponentsAfterSubscript(
bool ExponentsAfterSubscript)
956 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
957 bool UsePartialForDiff()
const {
return m_usePartialForDiff;}
958 void UsePartialForDiff(
bool usePartialForDiff)
959 {m_usePartialForDiff = usePartialForDiff;}
974 bool WrapLatexMath()
const {
return m_wrapLatexMath;}
975 void WrapLatexMath(
bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
976 bool AllowNetworkHelp()
const {
return m_allowNetworkHelp;}
977 void AllowNetworkHelp(
bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
978 bool ShowAllDigits()
const {
return m_showAllDigits;}
979 void ShowAllDigits(
bool shw){
980 if(m_showAllDigits != shw)
982 m_showAllDigits = shw;
984 bool LineBreaksInLongNums()
const {
return m_lineBreaksInLongNums;}
985 void LineBreaksInLongNums(
bool brk){
986 if(m_lineBreaksInLongNums != brk)
988 m_lineBreaksInLongNums = brk;
990 int MaxClipbrdBitmapMegabytes()
const {
return m_maxClipbrd_BitmapMegabytes;}
991 void MaxClipbrdBitmapMegabytes(
int maxClipbrd_BitmapMegabytes)
992 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
994 void MaximaUsesHtmlBrowser(
bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
995 bool MaximaUsesHtmlBrowser()
const {
return m_maximaUsesHhtmlBrowser;}
996 void MaximaUsesWxmaximaBrowser(
bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
998 void ExportContainsWXMX(
bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
999 bool ExportContainsWXMX()
const {
return m_exportContainsWXMX;}
1000 void WizardTab(
long tab){m_wizardTab = tab;}
1001 long WizardTab()
const {
return m_wizardTab;}
1003 void Display2d_Unicode(
bool unicode){m_display2d_Unicode = unicode;}
1004 bool Display2d_Unicode()
const {
return m_display2d_Unicode;}
1006 bool UseWGnuplot()
const {
return m_useWgnuplot;}
1008 void UseWGnuplot(
bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1010 wxString TexPreamble()
const {
return m_texPreamble;}
1011 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1013 void SetMaximaVersion(
const wxString &version){m_maximaVersion = version;}
1014 wxString GetMaximaVersion()
const {
return m_maximaVersion;}
1015 void SetMaximaArch(
const wxString &arch){m_maximaArch = arch;}
1016 wxString GetMaximaArch()
const {
return m_maximaArch;}
1017 void SetLispVersion(
const wxString &version){m_lispVersion = version;}
1018 wxString GetLispVersion()
const {
return m_lispVersion;}
1019 void SetLispType(
const wxString &type){m_lispType = type;}
1020 wxString GetLispType()
const {
return m_lispType;}
1026 bool FontRendersChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1027 wxTextCtrl *LastActiveTextCtrl()
const {
return m_lastActiveTextCtrl; }
1028 void LastActiveTextCtrl(wxTextCtrl *last);
1036 bool StyleAffectsCode(
TextStyle style)
const;
1037 bool StyleAffectsMathOut(
TextStyle style)
const;
1038 bool StyleAffectsColorOnly(
TextStyle style)
const;
1045 maximaHelpFormat MaximaHelpFormat()
const;
1046 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1049 wxString m_maximaArch;
1050 wxString m_lispVersion;
1051 wxString m_lispType;
1052 wxString m_maximaVersion;
1074 void RecalculateForce() { m_cellCfgCnt++; }
1075 static bool UseThreads(){
return m_use_threads;}
1076 static void UseThreads(
bool use){m_use_threads = use;}
1077 static void SetMaximaLang(
const wxString &LANG){m_maxima_LANG = LANG;}
1078 static wxString GetMaximaLang(){
return m_maxima_LANG;}
1081 static wxString m_maxima_LANG;
1083 std::vector<TextStyle> m_codeStyles;
1085 std::vector<TextStyle> m_2dMathStyles;
1087 std::vector<TextStyle> m_colorOnlyStyles;
1088 std::list<FileToSave> m_filesToSave;
1089 RenderablecharsHash m_renderableChars;
1090 RenderablecharsHash m_nonRenderableChars;
1092 static bool FontDisplaysChar(wxUniChar ch,
const wxFont &font = *wxNORMAL_FONT);
1094 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar,
const wxFont &font = *wxNORMAL_FONT);
1095 mathDisplayMode m_displayMode = display_2d;
1096 using CellRedrawTrace = std::vector<const Cell*>;
1097 static bool m_debugMode;
1098 bool m_showInputLabels;
1100 bool m_display2d_Unicode;
1101 bool m_usePartialForDiff;
1102 bool m_maximaUsesHhtmlBrowser;
1103 bool m_maximaUsesWxmaximaBrowser;
1105 bool m_autoSaveAsTempFile;
1109 bool m_autodetectMaxima;
1111 bool m_autodetectHelpBrowser;
1113 bool m_useInternalHelpBrowser;
1115 bool m_singlePageManual;
1117 wxRect m_updateRegion;
1119 bool m_incrementalSearch;
1121 long m_autoSubscript;
1123 wxWindow *m_workSheet = NULL;
1125 std::unique_ptr<wxClientDC> m_worksheetDC;
1140 bool m_wrapLatexMath;
1141 bool m_allowNetworkHelp;
1142 bool m_exportContainsWXMX;
1143 wxString m_texPreamble;
1146 wxString m_workingdir;
1147 bool m_TeXExponentsAfterSubscript;
1148 wxString m_helpBrowserUserLocation;
1149 wxString m_maximaUserLocation;
1151 bool m_hideBrackets;
1153 double m_printScale;
1154 double m_printMargin_Top;
1155 double m_printMargin_Bot;
1156 double m_printMargin_Left;
1157 double m_printMargin_Right;
1159 wxSize m_canvasSize;
1161 bool m_showBrackets;
1163 bool m_printBrackets;
1169 bool m_changeAsterisk;
1171 bool m_notifyIfIdle;
1173 long m_displayedDigits;
1179 bool m_showAllDigits;
1181 bool m_lineBreaksInLongNums;
1192 double m_zoomFactor;
1194 wxString m_maximaShareDir;
1195 wxString m_maximaDemoDir;
1197 bool m_clipToDrawRegion =
true;
1199 wxString m_maximaParameters;
1201 bool m_restartOnReEvaluation;
1202 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1204 long m_lineWidth_em;
1205 showLabels m_showLabelChoice;
1206 bool m_fixReorderedIndices;
1207 wxString m_mathJaxURL;
1208 bool m_mathJaxURL_UseUser;
1209 bool m_showCodeCells;
1212 bool m_copyMathMLHTML;
1217 bool m_enterEvaluates;
1223 bool m_TOCshowsSectionNumbers;
1224 bool m_useUnicodeMaths;
1226 bool m_abortOnError;
1227 bool m_showMatchingParens;
1228 bool m_hidemultiplicationsign;
1229 bool m_offerKnownAnswers;
1231 long m_maxGnuplotMegabytes;
1232 long m_defaultPlotHeight;
1233 long m_defaultPlotWidth;
1234 bool m_saveUntitled;
1236 bool m_numpadEnterEvaluates;
1237 bool m_saveImgFileName;
1245 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1246 wxString m_documentclass;
1247 wxString m_documentclassOptions;
1250 wxRect m_visibleRegion;
1252 wxPoint m_worksheetPosition;
1254 wxColour m_defaultBackgroundColor;
1256 wxBrush m_BackgroundBrush;
1257 wxBrush m_tooltipBrush;
1258 bool m_greekSidebar_ShowLatinLookalikes;
1262 bool m_useWgnuplot =
false;
1263 bool m_greekSidebar_Show_mu;
1264 wxString m_symbolPaneAdditionalChars;
1265 bool m_invertBackground;
1269 int m_defaultFramerate;
1271 int m_maxClipbrd_BitmapMegabytes;
1272 int m_autoSaveMinutes;
1273 wxString m_wxMathML_Filename;
1274 maximaHelpFormat m_maximaHelpFormat;
1275 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1276 std::int_fast32_t m_cellCfgCnt = 0;
1277 static bool m_use_threads;
1286 m_configuration = configuration;
1303 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:618
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:634
The configuration storage for the current worksheet.
Definition: Configuration.h:85
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1410
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:278
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:790
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:1005
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:919
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:726
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:775
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1441
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:823
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:219
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1044
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:559
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:260
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:453
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:220
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:439
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1022
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1031
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:582
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1067
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:390
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:210
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:183
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:544
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:234
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:596
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:552
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:884
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1057
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1203
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:136
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:738
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:1432
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:494
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:784
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1700
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1033
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:998
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:767
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:881
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:300
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1275
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:143
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:315
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1073
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:734
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:194
std::random_device m_rd
Our random device.
Definition: Configuration.h:1063
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:756
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:680
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:780
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:274
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:406
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:786
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:462
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1196
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:576
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:177
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:456
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:304
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:168
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:241
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:152
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:349
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:145
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:444
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:897
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:358
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:793
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:148
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:490
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1031
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:810
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:753
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:562
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1065
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:245
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:204
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:487
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1042
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:206
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:751
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:927
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1099
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:692
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:804
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:535
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:181
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:370
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1072
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:179
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:555
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1398
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:228
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:770
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1546
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:929
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1387
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:333
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:191
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:418
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:238
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:397
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:627
InitOpt
Definition: Configuration.h:118
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:120
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:778
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:853
drawMode
Definition: Configuration.h:112
@ ascii
Use ascii characters only.
Definition: Configuration.h:113
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:114
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:684
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:758
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1012
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:848
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:242
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1207
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:94
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:138
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:730
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1562
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1721
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:605
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:873
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:773
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:844
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:307
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1035
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:703
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1299
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1282
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:382