wxMaxima
Loading...
Searching...
No Matches
Configuration.h
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
22#ifndef CONFIGURATION_H
23#define CONFIGURATION_H
24
25#include "precomp.h"
26#include <wx/wx.h>
27#include <wx/config.h>
28#include <wx/display.h>
29#include <wx/fontenum.h>
30#include <wx/hashmap.h>
32#include "cells/TextStyle.h"
33#include <cstdint>
34#include <memory>
35#include <mutex>
36#include <unordered_map>
37#include <random>
38#include <list>
39#include <vector>
40#include <algorithm>
41#include <wx/wupdlock.h>
42
43#define MC_LINE_SKIP Scale_Px(2)
44#define MC_TEXT_PADDING Scale_Px(1)
45
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"
55#define SUM_DEC 2
56
58#define MC_HCARET_WIDTH 25
59
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 };
63
64// The minimal and maximal label width
65#define LABELWIDTH_MIN 3
66#define LABELWIDTH_MAX 10
67class Cell;
68
84{
85public:
86 enum maximaHelpFormat{
87 maxima = 0,
88 frontend = 1,
89 browser = 2
90 };
93 {
94 mathJaX_TeX = 0,
95 bitmap = 1,
96 mathML_mathJaX = 2,
97 svg = 3,
98 html_export_invalidChoice
99 };
100
101 enum showLabels : int8_t
102 {
103 labels_automatic = 0,
104 labels_prefer_user = 1,
105 labels_useronly = 2,
106 labels_none = 3,
107 labels_invalidSelection
108 };
109
111 {
113 handdrawn
114 };
115
117 {
118 none,
119 temporary
120 };
121
122 enum mathDisplayMode
123 {
124 display_2d,
125 display_2dASCII,
126 display_2dUNICODE,
127 display_1dASCII
128 };
129
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;
137 bool IsOperator(wxString name){return !(m_maximaOperators.find(name) == m_maximaOperators.end());}
138 const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
139 wxEnvVariableHashMap m_maximaEnvVars;
140
142 mathDisplayMode DisplayMode() const {return m_displayMode;}
144 void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
145
147 void SetWorkingDirectory(wxString dir)
148 { m_workingdir = std::move(dir); }
149
151 wxString GetWorkingDirectory() const
152 { return m_workingdir; }
153
155 void ReadConfig();
156
161 explicit Configuration(wxDC *dc = {}, InitOpt options = none);
162
164 void ResetAllToDefaults();
165
167 void SetRecalcContext(wxDC &dc)
168 {
169 m_dc = &dc;
170 }
171 void UnsetContext() {m_dc = NULL;}
172
174 void SetBackgroundBrush(const wxBrush &brush);
176 bool FixedFontInTextControls() const {return m_fixedFontTC;}
178 void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
180 wxBrush GetBackgroundBrush() const {return m_BackgroundBrush;}
182 wxBrush GetTooltipBrush() const {return m_tooltipBrush;}
183
184 virtual ~Configuration();
185
191
193 static std::unordered_map<TextStyle, wxString> m_styleNames;
194 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
195 using EscCodeIterator = EscCodeContainer::const_iterator;
196
198 static const wxString &GetEscCode(const wxString &key);
200 static EscCodeIterator EscCodesBegin();
202 static EscCodeIterator EscCodesEnd();
203
205 static double GetMinZoomFactor()
206 { return 0.1; }
207
209 static double GetMaxZoomFactor()
210 { return 32.0; }
211
218 double GetInterEquationSkip() const
219 {
221 return 0;
222 else
223 return GetZoomFactor() * m_styles[TS_MATH].GetFontSize() / 2;
224 }
225
227 wxCoord GetCellBracketWidth() const
228 {
229 return static_cast<wxCoord>(GetZoomFactor() * 16);
230 }
231
233 bool HideBrackets() const
234 { return m_hideBrackets; }
235
237 void HideBrackets(bool hide){m_hideBrackets = hide;}
238
240 double PrintScale() const
241 { return m_printScale; }
242
244 void PrintScale(double scale){m_printScale = scale;}
245
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;}
254
256 void SetZoomFactor(double newzoom);
257
259 void SetZoomFactor_temporarily(double newzoom){
260 if(m_zoomFactor != newzoom)
261 RecalculateForce();
262 m_zoomFactor = newzoom;
263 }
264
269 wxCoord Scale_Px(double px) const;
270 AFontSize Scale_Px(AFontSize size) const;
271
273 double GetZoomFactor() const
274 { return m_zoomFactor; }
275
277 wxDC *GetRecalcDC() const
278 { return m_dc; }
279
280 void SetRecalcDC(wxDC *dc)
281 { m_dc = dc; }
282
283 wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
284
285 // cppcheck-suppress functionStatic
286 // cppcheck-suppress functionConst
287 wxString GetSymbolFontName() const;
288
289 wxFontWeight IsBold(long st) const;
290
291 wxFontStyle IsItalic(long st) const;
292
293 bool IsUnderlined(long st) const {return m_styles[st].IsUnderlined();}
294
299 wxCoord GetLabelWidth() const
300 { return m_labelWidth * 14; }
301
303 long LabelWidth() const
304 { return m_labelWidth; }
306 void LabelWidth(long labelWidth)
307 {
308 if(m_labelWidth != labelWidth)
309 RecalculateForce();
310 m_labelWidth = labelWidth;
311 }
312
314 wxCoord GetIndent() const
315 {
316 if (m_indent < 0)
317 return 3 * GetCellBracketWidth() / 2;
318 else
319 return m_indent;
320 }
321
327 wxSize GetPPI() const;
328 int AutosaveMinutes() const {return m_autoSaveMinutes;}
329 void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
330
332 long GetCursorWidth() const
333 {
334 long ppi;
335
336 if(!m_printing)
337 ppi = GetPPI().x;
338 else
339 ppi = 96;
340
341 if (ppi / 45 < 1)
342 return 1;
343 else
344 return ppi / 45;
345 }
346
348 long GetBaseIndent() const
349 {
350 if (GetCursorWidth() < 12)
351 return 12;
352 else
353 return 4 + GetCursorWidth();
354 }
355
357 long GetGroupSkip() const
358 {
359 if (GetCursorWidth() < 10)
360 return 20;
361 else
362 return 10 + GetCursorWidth();
363 }
364
369 void SetIndent(long indent)
370 {
371 if(m_indent != indent)
372 RecalculateForce();
373 m_indent = indent;
374 }
375
376 bool IncrementalSearch() const {return m_incrementalSearch;}
377
378
379 void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
380
381 struct CharsExist {
382 wxString chars;
383 bool exist;
384 CharsExist(const wxString &chars, bool exist) : chars(chars), exist(exist) {}
385 };
386 std::vector<CharsExist> m_charsInFont;
387
390 {
391 m_charsInFont.clear();
392 RecalculateForce();
393 }
394
396 double GetDefaultLineWidth() const
397 {
398 if (GetZoomFactor() < 1.0)
399 return 1.0;
400 else
401 return GetZoomFactor();
402 }
403
405 long LineWidth_em() const
406 {
407 if(!m_printing)
408 return m_lineWidth_em;
409 else
410 return 10000;
411 }
412
413 bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
414 void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
415
417 void LineWidth_em(long width)
418 { m_lineWidth_em = width; }
419
421 // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
422 // But text blocks that are 1 meter wide and 2 cm high feel - weird.
423 long GetLineWidth() const;
424
425 bool SaveUntitled() const { return m_saveUntitled;}
426 void SaveUntitled(bool save) {m_saveUntitled = save;}
427
428 bool CursorJump() const { return m_cursorJump;}
429 void CursorJump(bool save){m_cursorJump = save;}
430
431 bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
432 void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
433
434 bool SaveImgFileName() const { return m_saveImgFileName;}
435 void SaveImgFileName(bool save) { m_saveImgFileName = save;}
436
438 bool GetAutoWrap() const
439 { return m_autoWrap > 0; }
440
441 // cppcheck-suppress functionStatic
443 static bool GetAutoWrapCode()
444 { return false; }
445
452 void SetAutoWrap(long autoWrap){m_autoWrap = autoWrap;}
453
455 bool GetAutoIndent() const
456 { return m_autoIndent; }
457
458 void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
459
461 bool IndentMaths() const {return m_indentMaths;}
462 void IndentMaths(bool indent){
463 if(m_indentMaths != indent)
464 RecalculateForce();
465 m_indentMaths = indent;}
466 AFontSize GetFontSize(TextStyle st) const { return m_styles[st].GetFontSize(); }
467
468 static const wxString &GetStyleName(TextStyle textStyle);
469
475 void ReadStyles(const wxString &file = {});
476
481 void WriteStyles(const wxString &file = {});
482 void WriteStyles(wxConfigBase *config);
483 void WriteSettings(const wxString &file = {});
484 void MakeStylesConsistent();
485 void Outdated(bool outdated)
486 { m_outdated = outdated; }
487
489 bool CheckKeepPercent() const
490 { return m_keepPercent; }
491
493 void SetKeepPercent(bool keepPercent)
494 {
495 if(m_keepPercent != keepPercent)
496 RecalculateForce();
497 m_keepPercent = keepPercent;
498 }
499
500 wxString GetTeXCMRI() const
501 { return m_fontCMRI; }
502
503 wxString GetTeXCMSY() const
504 { return m_fontCMSY; }
505
506 wxString GetTeXCMEX() const
507 { return m_fontCMEX; }
508
509 wxString GetTeXCMMI() const
510 { return m_fontCMMI; }
511
512 wxString GetTeXCMTI() const
513 { return m_fontCMTI; }
514
515 bool ShowCodeCells() const
516 { return m_showCodeCells; }
517
518 void ShowCodeCells(bool show);
519
526 void SetPrinting(bool printing);
527
534 bool GetPrinting() const
535 { return m_printing; }
536
538 wxColour GetColor(TextStyle style);
539
541 static wxColour InvertColour(wxColour col);
542
547 wxColor MakeColorDifferFromBackground(wxColor color);
548
549 bool UsePngCairo() const { return m_usepngCairo;}
550 void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
551
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; }
556
558 bool GetChangeAsterisk() const{ return m_changeAsterisk; }
559
561 void SetChangeAsterisk(bool changeAsterisk) {
562 if(m_changeAsterisk != changeAsterisk)
563 RecalculateForce();
564 m_changeAsterisk = changeAsterisk;
565 }
566
567 bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
568
569 void HidemultiplicationSign(bool show) {
570 if(m_hidemultiplicationsign != show)
571 RecalculateForce();
572 m_hidemultiplicationsign = show;
573 }
574
575 bool Latin2Greek() const
576 {return m_latin2greek;}
577
578 void Latin2Greek(bool latin2greek) {
579 if(m_latin2greek != latin2greek)
580 RecalculateForce();
581 m_latin2greek = latin2greek;
582 }
583
584 bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
585 void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
586
587 bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
588 void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
589
590 wxString SymbolPaneAdditionalChars() const
591 {return m_symbolPaneAdditionalChars;}
592 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
593
595 bool NotifyIfIdle() const
596 { return m_notifyIfIdle; }
597
598 void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
599
605 { return m_displayedDigits; }
606
607 void SetDisplayedDigits(long displayedDigits)
608 {
609 wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
610 if(m_displayedDigits != displayedDigits)
611 RecalculateForce();
612 m_displayedDigits = displayedDigits;
613 }
614
617 {
618 public:
619 FileToSave(const wxString &filename, const wxMemoryBuffer &data):
620 m_data(data),
621 m_filename(filename)
622 {
623 }
624 const wxString FileName() const{return m_filename;}
625 const wxMemoryBuffer Data() const{return m_data;}
626 private:
627 const wxMemoryBuffer m_data;
628 const wxString m_filename;
629 };
630
633 {
634 public:
635 TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
636 m_pos(pos),
637 m_text(text),
638 m_color(color)
639 {
640 }
641 const wxPoint Pos() const{return m_pos;}
642 const wxString Text() const{return m_text;}
643 const wxColor Color() const{return m_color;}
644 private:
645 const wxPoint m_pos;
646 const wxString m_text;
647 const wxColor m_color;
648 };
649
650 FileToSave PopFileToSave();
651 void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
652 { m_filesToSave.emplace_front(FileToSave(filename, data)); }
653
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;}
658
661 bool InUpdateRegion(wxRect rect) const;
662
663 bool GetInsertAns() const
664 { return m_insertAns; }
665
666 void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
667
668 bool GetOpenHCaret() const
669 { return m_openHCaret; }
670
671 void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
672
673 bool RestartOnReEvaluation() const
674 { return m_restartOnReEvaluation; }
675
676 void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
677
679 wxSize GetCanvasSize() const
680 { return m_canvasSize; }
681
683 void SetCanvasSize(wxSize siz)
684 {
685 if(m_canvasSize.GetWidth() != siz.GetWidth())
686 RecalculateForce();
687 m_canvasSize = siz;
688 }
689
691 bool ShowBrackets() const
692 { return m_showBrackets; }
693
694 bool ShowBrackets(bool show)
695 {
696 if(m_showBrackets != show)
697 RecalculateForce();
698 return m_showBrackets = show;
699 }
700
702 bool PrintBrackets() const
703 { return m_printBrackets; }
704
705 showLabels GetLabelChoice() const
706 { return m_showLabelChoice; }
707
708 bool ShowInputLabels() const {return m_showInputLabels;}
709 void ShowInputLabels(bool show) {
710 if(m_showInputLabels != show)
711 RecalculateForce();
712 m_showInputLabels = show;
713 }
714
715 bool InvertBackground() const {return m_invertBackground;}
716 void InvertBackground(bool invert){ m_invertBackground = invert; }
717
718 long UndoLimit(){return std::max(m_undoLimit, static_cast<long>(0));}
719 void UndoLimit(long limit){ m_undoLimit = limit; }
720
721 long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
722 void RecentItems(long items){ m_recentItems = items; }
723
726 { return (m_showLabelChoice < labels_useronly); }
727
729 bool UseUserLabels() const
730 { return m_showLabelChoice > labels_automatic; }
731
733 bool ShowLabels() const
734 { return m_showLabelChoice < labels_none; }
735
737 void SetLabelChoice(showLabels choice) {
738 if(m_showLabelChoice != choice)
739 RecalculateForce();
740 m_showLabelChoice = choice;
741 }
742
743 bool PrintBrackets(bool print)
744 {
745 m_printBrackets = print;
746 return print;
747 }
748
750 bool AutodetectMaxima() const {return m_autodetectMaxima;}
752 void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
753
755 wxString MaximaParameters() const {return m_maximaParameters;}
757 void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
758
760 static wxString MaximaDefaultLocation();
761
763 wxString MaximaLocation() const;
764
766 wxString MaximaUserLocation() const {return m_maximaUserLocation;}
767
769 void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
770
772 bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
774 void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
775
777 bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
779 void InternalHelpBrowser(bool useInternalHelpBrowser)
780 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
781
783 bool SinglePageManual() const {return m_singlePageManual;}
785 void SinglePageManual(bool singlePageManual)
786 {m_singlePageManual = singlePageManual;}
787
789 wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
790
792 void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
793
800 static wxString FindProgram(const wxString &location);
801
804 { return m_fixReorderedIndices; }
805
806 void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
807
809 wxString MathJaXURL() const {
810 if(m_mathJaxURL_UseUser)
811 return m_mathJaxURL;
812 else
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;}
817
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);}
823
824 bool CopyBitmap() const {return m_copyBitmap;}
825 void CopyBitmap(bool copyBitmap){ m_copyBitmap = copyBitmap; }
826
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 ;}
843 void ShowLength(long length) {
844 m_showLength = length;
845 }
847 long ShowLength() const {return m_showLength;}
849 std::size_t ShowLength_Bytes() const;
850
853 if(m_parenthesisDrawMode != mode)
854 RecalculateForce();
855 m_parenthesisDrawMode = mode;
856 }
857
858 void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
859
860 bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
861
862 void UseUnicodeMaths(bool useunicodemaths)
863 { m_useUnicodeMaths = useunicodemaths; }
864 bool UseUnicodeMaths() const {return m_useUnicodeMaths;}
865
866 StringBoolHash m_hideMarkerForThisMessage;
867
872 const Style *GetStyle(TextStyle textStyle) const { return &m_styles[textStyle]; }
880 Style *GetWritableStyle(TextStyle textStyle) { return &m_styles[textStyle]; }
881
883 wxWindow *GetWorkSheet() const {return m_workSheet;}
885 void SetWorkSheet(wxWindow *workSheet);
886
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;}
891
892 long GetLanguage() const {return m_language;}
893 void SetLanguage(long language) {m_language = language;}
894
896 long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
897 void MaxGnuplotMegabytes(long megaBytes)
898 {m_maxGnuplotMegabytes = megaBytes;}
899
900 bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
901 void OfferKnownAnswers(bool offerKnownAnswers)
902 {m_offerKnownAnswers = offerKnownAnswers;}
903
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);}
908
909
910 htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
911 void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
912 {m_htmlEquationFormat = HTMLequationFormat;}
913
914 AFontSize GetDefaultFontSize() const { return m_styles[TS_CODE_DEFAULT].GetFontSize(); }
915 AFontSize GetMathFontSize() const { return m_styles[TS_MATH].GetFontSize(); }
916
918 long GetAutosubscript_Num() const {return m_autoSubscript;}
919 void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
920 wxString GetAutosubscript_string() const;
922 wxColor DefaultBackgroundColor();
924 wxColor EditorBackgroundColor();
926 bool ClipToDrawRegion() const {return m_clipToDrawRegion;}
928 void ClipToDrawRegion(bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate = true;}
929 void SetVisibleRegion(wxRect visibleRegion){
930 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
931 RecalculateForce();
932 m_visibleRegion = visibleRegion;
933 }
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;}
960 void NotifyOfCellRedraw(const Cell *cell);
972 bool OfferInternalHelpBrowser() const;
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)
980 RecalculateForce();
981 m_showAllDigits = shw;
982 }
983 bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
984 void LineBreaksInLongNums(bool brk){
985 if(m_lineBreaksInLongNums != brk)
986 RecalculateForce();
987 m_lineBreaksInLongNums = brk;
988 }
989 int MaxClipbrdBitmapMegabytes() const {return m_maxClipbrd_BitmapMegabytes;}
990 void MaxClipbrdBitmapMegabytes(int maxClipbrd_BitmapMegabytes)
991 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
992
993 void MaximaUsesHtmlBrowser(bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
994 bool MaximaUsesHtmlBrowser() const {return m_maximaUsesHhtmlBrowser;}
995 void MaximaUsesWxmaximaBrowser(bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
996 bool MaximaUsesWxmaximaBrowser() const {return m_maximaUsesWxmaximaBrowser && OfferInternalHelpBrowser();}
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;}
1001
1002 void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1003 bool Display2d_Unicode() const {return m_display2d_Unicode;}
1004
1005 #ifdef __WXMSW__
1006 bool UseWGnuplot() const {return m_useWgnuplot;}
1007 void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1008 #endif
1009 wxString TexPreamble() const {return m_texPreamble;}
1010 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1011
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;}
1020
1021 Style m_styles[NUMBEROFSTYLES];
1023 void InitStyles();
1025 bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1026 wxTextCtrl *LastActiveTextCtrl() const { return m_lastActiveTextCtrl; }
1027 void LastActiveTextCtrl(wxTextCtrl *last);
1028
1030 const std::vector<TextStyle> &GetCodeStylesList() const {return m_codeStyles;}
1032 const std::vector<TextStyle> &GetMathStylesList() const {return m_2dMathStyles;}
1034 const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_colorOnlyStyles;}
1035 bool StyleAffectsCode(TextStyle style) const;
1036 bool StyleAffectsMathOut(TextStyle style) const;
1037 bool StyleAffectsColorOnly(TextStyle style) const;
1039 bool UpdateNeeded() const;
1041 static void SetDebugmode(){m_debugMode = true;}
1043 static bool GetDebugmode(){return m_debugMode;}
1044 maximaHelpFormat MaximaHelpFormat() const;
1045 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1046
1047private:
1048 wxString m_maximaArch;
1049 wxString m_lispVersion;
1050 wxString m_lispType;
1051 wxString m_maximaVersion;
1053 InitOpt m_initOpts;
1059 long m_configId;
1060public:
1062 std::random_device m_rd;
1064 std::default_random_engine m_eng;
1072 std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
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;}
1078private:
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;
1098 long m_wizardTab;
1099 bool m_display2d_Unicode;
1100 bool m_usePartialForDiff;
1101 bool m_maximaUsesHhtmlBrowser;
1102 bool m_maximaUsesWxmaximaBrowser;
1104 bool m_autoSaveAsTempFile;
1106 long m_language;
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;
1137// bool CharsExistInFont(const wxFont &font, const wxString& chars);
1139 bool m_wrapLatexMath;
1140 bool m_allowNetworkHelp;
1141 bool m_exportContainsWXMX;
1142 wxString m_texPreamble;
1143
1144 drawMode m_parenthesisDrawMode;
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;
1174 long m_autoWrap;
1176 bool m_autoIndent;
1178 bool m_showAllDigits;
1180 bool m_lineBreaksInLongNums;
1182 bool m_matchParens;
1184 bool m_insertAns;
1186 bool m_openHCaret;
1188 long m_labelWidth;
1189 long m_indent;
1190 bool m_latin2greek;
1191 double m_zoomFactor;
1192 wxDC *m_dc;
1193 wxString m_maximaShareDir;
1194 wxString m_maximaDemoDir;
1195 bool m_forceUpdate;
1196 bool m_clipToDrawRegion = true;
1197 bool m_outdated;
1198 wxString m_maximaParameters;
1199 bool m_keepPercent;
1200 bool m_restartOnReEvaluation;
1201 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1202 bool m_printing;
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;
1209 bool m_copyBitmap;
1210 bool m_copyMathML;
1211 bool m_copyMathMLHTML;
1212 long m_showLength;
1214 bool m_inLispMode;
1215 bool m_usepngCairo;
1216 bool m_enterEvaluates;
1217 bool m_useSVG;
1218 bool m_fixedFontTC;
1219 bool m_copyRTF;
1220 bool m_copySVG;
1221 bool m_copyEMF;
1222 bool m_TOCshowsSectionNumbers;
1223 bool m_useUnicodeMaths;
1224 bool m_indentMaths;
1225 bool m_abortOnError;
1226 bool m_showMatchingParens;
1227 bool m_hidemultiplicationsign;
1228 bool m_offerKnownAnswers;
1229 long m_defaultPort;
1230 long m_maxGnuplotMegabytes;
1231 long m_defaultPlotHeight;
1232 long m_defaultPlotWidth;
1233 bool m_saveUntitled;
1234 bool m_cursorJump;
1235 bool m_numpadEnterEvaluates;
1236 bool m_saveImgFileName;
1244 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1245 wxString m_documentclass;
1246 wxString m_documentclassOptions;
1247 htmlExportFormat m_htmlEquationFormat;
1249 wxRect m_visibleRegion;
1251 wxPoint m_worksheetPosition;
1252
1253 wxColour m_defaultBackgroundColor;
1255 wxBrush m_BackgroundBrush;
1256 wxBrush m_tooltipBrush;
1257 bool m_greekSidebar_ShowLatinLookalikes;
1258 #ifdef __WXMSW__
1259 bool m_useWgnuplot = false;
1260 #endif
1261 bool m_greekSidebar_Show_mu;
1262 wxString m_symbolPaneAdditionalChars;
1263 bool m_invertBackground;
1264 long m_undoLimit;
1265 long m_recentItems;
1266 int m_bitmapScale;
1267 int m_defaultFramerate;
1268 int m_tocDepth;
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;
1276};
1277
1280{
1281public:
1282 explicit Printing(Configuration *configuration)
1283 {
1284 m_configuration = configuration;
1285 m_configuration->SetPrinting(true);
1286 }
1287 virtual ~Printing()
1288 {
1289 m_configuration->SetPrinting(false);
1290 }
1291private:
1292 Configuration * m_configuration;
1293};
1294
1297{
1298public:
1299 explicit NoClipToDrawRegion(Configuration *configuration)
1300 {
1301 m_configuration = configuration;
1302 m_configuration->ClipToDrawRegion(false);
1303 }
1304 virtual ~NoClipToDrawRegion()
1305 {
1306 m_configuration->ClipToDrawRegion(true);
1307 }
1308private:
1309 Configuration * m_configuration;
1310};
1311
1312#endif // CONFIGURATION_H
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