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 <atomic>
42#include <wx/wupdlock.h>
43#include <list>
44
45#define MC_LINE_SKIP Scale_Px(2)
46#define MC_TEXT_PADDING Scale_Px(1)
47
48#define PAREN_OPEN_TOP_UNICODE "\u239b"
49#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
50#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
51#define PAREN_CLOSE_TOP_UNICODE "\u239e"
52#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
53#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
54#define SUM_SIGN "\u2211"
55#define PROD_SIGN "\u220F"
57#define SUM_DEC 2
58
60#define MC_HCARET_WIDTH 25
61
62#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
63static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
64static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
65
66// The minimal and maximal label width
67#define LABELWIDTH_MIN 3
68#define LABELWIDTH_MAX 10
69class Cell;
70
86{
87public:
89 std::atomic<long> manualAnchorsFromBuiltin{0};
90 std::atomic<long> manualAnchorsFromCache{0};
91 std::atomic<long> manualAnchorsCompiled{0};
92 std::atomic<long> maximaProcessesSpawned{0};
93 std::atomic<long> fontCacheHits{0};
94 std::atomic<long> fontCacheMisses{0};
95 std::atomic<long> recalculationNeeded_FontInvalid{0};
96 std::atomic<long> recalculationNeeded_SizeInvalid{0};
97 std::atomic<long> recalculationNeeded_FontMismatch{0};
98 std::atomic<long> recalculationNeeded_ConfigChanged{0};
99 std::atomic<long> recalculationNeeded_CellsAppended{0};
100 std::atomic<long> recalculationNeeded_EditorDirty{0};
101 std::atomic<long> cellsConvertedToLinear{0};
102 std::atomic<long> cellsConvertedTo2D{0};
103 void Report() const;
104 };
105 static PerformanceStats g_stats;
106
107 enum maximaHelpFormat{
108 maxima = 0,
109 frontend = 1,
110 browser = 2
111 };
114 {
115 mathJaX_TeX = 0,
116 bitmap = 1,
117 mathML_mathJaX = 2,
118 svg = 3,
119 html_export_invalidChoice
120 };
121
122 enum showLabels : int8_t
123 {
124 labels_automatic = 0,
125 labels_prefer_user = 1,
126 labels_useronly = 2,
127 labels_none = 3,
128 labels_invalidSelection
129 };
130
132 {
134 handdrawn
135 };
136
138 {
139 none,
140 temporary
141 };
142
143 enum mathDisplayMode
144 {
145 display_2d,
146 display_2dASCII,
147 display_2dUNICODE,
148 display_1dASCII
149 };
150
151 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
152 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
153 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
158 bool IsOperator(wxString name){return !(m_maximaOperators.find(name) == m_maximaOperators.end());}
159 const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
160 wxEnvVariableHashMap m_maximaEnvVars;
161
163 mathDisplayMode DisplayMode() const {return m_displayMode;}
165 void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
166
168 void SetWorkingDirectory(wxString dir)
169 { m_workingdir = std::move(dir); }
170
172 wxString GetWorkingDirectory() const
173 { return m_workingdir; }
174
176 void ReadConfig();
177
182 explicit Configuration(wxDC *dc = {}, InitOpt options = none);
184
186 void ResetAllToDefaults();
187
189 void SetRecalcContext(wxDC &dc)
190 {
191 m_dc = &dc;
192 }
193 void UnsetContext() {m_dc = NULL;}
194
196 void SetBackgroundBrush(const wxBrush &brush);
198 bool FixedFontInTextControls() const {return m_fixedFontTC;}
200 void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
202 wxBrush GetBackgroundBrush() const {return m_BackgroundBrush;}
204 wxBrush GetTooltipBrush() const {return m_tooltipBrush;}
205
206 virtual ~Configuration();
207
213
215 static std::unordered_map<TextStyle, wxString> m_styleNames;
216 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
217 using EscCodeIterator = EscCodeContainer::const_iterator;
218
220 static const wxString &GetEscCode(const wxString &key);
222 static EscCodeIterator EscCodesBegin();
224 static EscCodeIterator EscCodesEnd();
225
227 static double GetMinZoomFactor()
228 { return 0.1; }
229
231 static double GetMaxZoomFactor()
232 { return 32.0; }
233
240 double GetInterEquationSkip() const
241 {
243 return 0;
244 else
245 return GetZoomFactor() * m_styles[TS_MATH].GetFontSize() / 2;
246 }
247
249 wxCoord GetCellBracketWidth() const
250 {
251 return static_cast<wxCoord>(GetZoomFactor() * 16);
252 }
253
255 bool HideBrackets() const
256 { return m_hideBrackets; }
257
259 void HideBrackets(bool hide){m_hideBrackets = hide;}
260
262 double PrintScale() const
263 { return m_printScale; }
264
266 void PrintScale(double scale){m_printScale = scale;}
267
268 void PrintMargin_Top(double margin){m_printMargin_Top = margin;}
269 void PrintMargin_Bot(double margin){m_printMargin_Bot = margin;}
270 void PrintMargin_Left(double margin){m_printMargin_Left = margin;}
271 void PrintMargin_Right(double margin){m_printMargin_Right = margin;}
272 double PrintMargin_Top() const {return m_printMargin_Top;}
273 double PrintMargin_Bot() const {return m_printMargin_Bot;}
274 double PrintMargin_Left() const {return m_printMargin_Left;}
275 double PrintMargin_Right() const {return m_printMargin_Right;}
276
278 void SetZoomFactor(double newzoom);
279
281 void SetZoomFactor_temporarily(double newzoom){
282 if(m_zoomFactor != newzoom)
283 RecalculateForce();
284 m_zoomFactor = newzoom;
285 }
286
291 wxCoord Scale_Px(double px) const;
292 AFontSize Scale_Px(AFontSize size) const;
293
295 double GetZoomFactor() const
296 { return m_zoomFactor; }
297
299 wxDC *GetRecalcDC() const
300 { return m_dc; }
301
302 void SetRecalcDC(wxDC *dc)
303 { m_dc = dc; }
304
305 wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
306
307 // cppcheck-suppress functionStatic
308 // cppcheck-suppress functionConst
309 wxString GetSymbolFontName() const;
310
312 static const wxString CharsNeedingQuotes()
313 {
314 return wxString(wxS("°,\\'\"()[]-{}^+*/&§?:;=#<>$"));
315 }
316
317 wxFontWeight IsBold(long st) const;
318
319 wxFontStyle IsItalic(long st) const;
320
321 bool IsUnderlined(long st) const {return m_styles[st].IsUnderlined();}
322
327 wxCoord GetLabelWidth() const
328 { return m_labelWidth * 14; }
329
331 long LabelWidth() const
332 { return m_labelWidth; }
334 void LabelWidth(long labelWidth)
335 {
336 if(m_labelWidth != labelWidth)
337 RecalculateForce();
338 m_labelWidth = labelWidth;
339 }
340
342 wxCoord GetIndent() const
343 {
344 if (m_indent < 0)
345 return 3 * GetCellBracketWidth() / 2;
346 else
347 return m_indent;
348 }
349
355 wxSize GetPPI() const;
356 int AutosaveMinutes() const {return m_autoSaveMinutes;}
357 void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
358
360 long GetCursorWidth() const
361 {
362 long ppi;
363
364 if(!m_printing)
365 ppi = GetPPI().x;
366 else
367 ppi = 96;
368
369 if (ppi / 45 < 1)
370 return 1;
371 else
372 return ppi / 45;
373 }
374
376 long GetBaseIndent() const
377 {
378 if (GetCursorWidth() < 12)
379 return 12;
380 else
381 return 4 + GetCursorWidth();
382 }
383
385 long GetGroupSkip() const
386 {
387 if (GetCursorWidth() < 10)
388 return 20;
389 else
390 return 10 + GetCursorWidth();
391 }
392
397 void SetIndent(long indent)
398 {
399 if(m_indent != indent)
400 RecalculateForce();
401 m_indent = indent;
402 }
403
404 bool IncrementalSearch() const {return m_incrementalSearch;}
405
406
407 void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
408
409 int MaxLayoutTime() const { return m_maxLayoutTime; }
410 void MaxLayoutTime(int time) { m_maxLayoutTime = time; }
411
412 struct CharsExist {
413 wxString chars;
414 bool exist;
415 CharsExist(const wxString &chars, bool exist) : chars(chars), exist(exist) {}
416 };
417 std::vector<CharsExist> m_charsInFont;
418
421 {
422 m_charsInFont.clear();
423 RecalculateForce();
424 }
425
427 double GetDefaultLineWidth() const
428 {
429 if (GetZoomFactor() < 1.0)
430 return 1.0;
431 else
432 return GetZoomFactor();
433 }
434
436 long LineWidth_em() const
437 {
438 if(!m_printing)
439 return m_lineWidth_em;
440 else
441 return 10000;
442 }
443
444 bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
445 void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
446
448 void LineWidth_em(long width)
449 { m_lineWidth_em = width; }
450
452 // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
453 // But text blocks that are 1 meter wide and 2 cm high feel - weird.
454 long GetLineWidth() const;
455
456 bool SaveUntitled() const { return m_saveUntitled;}
457 void SaveUntitled(bool save) {m_saveUntitled = save;}
458
459 bool CursorJump() const { return m_cursorJump;}
460 void CursorJump(bool save){m_cursorJump = save;}
461
462 bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
463 void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
464
465 bool SaveImgFileName() const { return m_saveImgFileName;}
466 void SaveImgFileName(bool save) { m_saveImgFileName = save;}
467
469 bool GetAutoWrap() const
470 { return m_autoWrap > 0; }
471
472 // cppcheck-suppress functionStatic
474 static bool GetAutoWrapCode()
475 { return false; }
476
483 void SetAutoWrap(long autoWrap){m_autoWrap = autoWrap;}
484
486 bool GetAutoIndent() const
487 { return m_autoIndent; }
488
489 void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
490
492 bool IndentMaths() const {return m_indentMaths;}
493 void IndentMaths(bool indent){
494 if(m_indentMaths != indent)
495 RecalculateForce();
496 m_indentMaths = indent;}
497 AFontSize GetFontSize(TextStyle st) const { return m_styles[st].GetFontSize(); }
498
499 static const wxString &GetStyleName(TextStyle textStyle);
500
506 void ReadStyles(const wxString &file = {});
507
512 void WriteStyles(const wxString &file = {});
513 void WriteStyles(wxConfigBase *config);
514 void WriteSettings(const wxString &file = {});
515 void MakeStylesConsistent();
516 void Outdated(bool outdated)
517 { m_outdated = outdated; }
518
520 bool CheckKeepPercent() const
521 { return m_keepPercent; }
522
524 void SetKeepPercent(bool keepPercent)
525 {
526 if(m_keepPercent != keepPercent)
527 RecalculateForce();
528 m_keepPercent = keepPercent;
529 }
530
531 wxString GetTeXCMRI() const
532 { return m_fontCMRI; }
533
534 wxString GetTeXCMSY() const
535 { return m_fontCMSY; }
536
537 wxString GetTeXCMEX() const
538 { return m_fontCMEX; }
539
540 wxString GetTeXCMMI() const
541 { return m_fontCMMI; }
542
543 wxString GetTeXCMTI() const
544 { return m_fontCMTI; }
545
546 bool ShowCodeCells() const
547 { return m_showCodeCells; }
548
549 void ShowCodeCells(bool show);
550
557 void SetPrinting(bool printing);
558
565 bool GetPrinting() const
566 { return m_printing; }
567
569 wxColour GetColor(TextStyle style);
570
572 static wxColour InvertColour(wxColour col);
573
578 wxColor MakeColorDifferFromBackground(wxColor color);
579
580 bool UsePngCairo() const { return m_usepngCairo;}
581 void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
582
583 bool GetMatchParens() const { return m_matchParens; }
584 void SetMatchParens(bool matchParens) { m_matchParens = matchParens; }
585 bool ShowMatchingParens() const { return m_showMatchingParens; }
586 void ShowMatchingParens(bool show) { m_showMatchingParens = show; }
587
589 bool GetChangeAsterisk() const{ return m_changeAsterisk; }
590
592 void SetChangeAsterisk(bool changeAsterisk) {
593 if(m_changeAsterisk != changeAsterisk)
594 RecalculateForce();
595 m_changeAsterisk = changeAsterisk;
596 }
597
598 bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
599
600 void HidemultiplicationSign(bool show) {
601 if(m_hidemultiplicationsign != show)
602 RecalculateForce();
603 m_hidemultiplicationsign = show;
604 }
605
606 bool Latin2Greek() const
607 {return m_latin2greek;}
608
609 void Latin2Greek(bool latin2greek) {
610 if(m_latin2greek != latin2greek)
611 RecalculateForce();
612 m_latin2greek = latin2greek;
613 }
614
615 bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
616 void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
617
618 bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
619 void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
620
621 wxString SymbolPaneAdditionalChars() const
622 {return m_symbolPaneAdditionalChars;}
623 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
624
626 bool NotifyIfIdle() const
627 { return m_notifyIfIdle; }
628
629 void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
630
636 { return m_displayedDigits; }
637
638 void SetDisplayedDigits(long displayedDigits)
639 {
640 wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
641 if(m_displayedDigits != displayedDigits)
642 RecalculateForce();
643 m_displayedDigits = displayedDigits;
644 }
645
648 {
649 public:
650 FileToSave(const wxString &filename, const wxMemoryBuffer &data):
651 m_data(data),
652 m_filename(filename)
653 {
654 }
655 const wxString FileName() const{return m_filename;}
656 const wxMemoryBuffer Data() const{return m_data;}
657 private:
658 const wxMemoryBuffer m_data;
659 const wxString m_filename;
660 };
661
664 {
665 public:
666 TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
667 m_pos(pos),
668 m_text(text),
669 m_color(color)
670 {
671 }
672 const wxPoint Pos() const{return m_pos;}
673 const wxString Text() const{return m_text;}
674 const wxColor Color() const{return m_color;}
675 private:
676 const wxPoint m_pos;
677 const wxString m_text;
678 const wxColor m_color;
679 };
680
681 FileToSave PopFileToSave();
682 void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
683 { m_filesToSave.emplace_front(FileToSave(filename, data)); }
684
685 wxRect GetUpdateRegion() const {return m_updateRegion;}
686 const std::list<FileToSave> &GetFilesToSave() const {return m_filesToSave;}
687 void ClearFilesToSave () { m_filesToSave.clear();}
688 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
689
692 bool InUpdateRegion(wxRect rect) const;
693
694 bool GetInsertAns() const
695 { return m_insertAns; }
696
697 void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
698
699 bool GetOpenHCaret() const
700 { return m_openHCaret; }
701
702 void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
703
704 bool RestartOnReEvaluation() const
705 { return m_restartOnReEvaluation; }
706
707 void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
708
710 wxSize GetCanvasSize() const
711 { return m_canvasSize; }
712
714 void SetCanvasSize(wxSize siz)
715 {
716 if(m_canvasSize.GetWidth() != siz.GetWidth())
717 RecalculateForce();
718 m_canvasSize = siz;
719 }
720
722 bool ShowBrackets() const
723 { return m_showBrackets; }
724
725 bool ShowBrackets(bool show)
726 {
727 if(m_showBrackets != show)
728 RecalculateForce();
729 return m_showBrackets = show;
730 }
731
733 bool PrintBrackets() const
734 { return m_printBrackets; }
735
736 showLabels GetLabelChoice() const
737 { return m_showLabelChoice; }
738
739 bool ShowInputLabels() const {return m_showInputLabels;}
740 void ShowInputLabels(bool show) {
741 if(m_showInputLabels != show)
742 RecalculateForce();
743 m_showInputLabels = show;
744 }
745
746 bool InvertBackground() const {return m_invertBackground;}
747 void InvertBackground(bool invert){ m_invertBackground = invert; }
748
749 long UndoLimit(){return std::max(m_undoLimit, static_cast<long>(0));}
750 void UndoLimit(long limit){ m_undoLimit = limit; }
751
752 long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
753 void RecentItems(long items){ m_recentItems = items; }
754
757 { return (m_showLabelChoice < labels_useronly); }
758
760 bool UseUserLabels() const
761 { return m_showLabelChoice > labels_automatic; }
762
764 bool ShowLabels() const
765 { return m_showLabelChoice < labels_none; }
766
768 void SetLabelChoice(showLabels choice) {
769 if(m_showLabelChoice != choice)
770 RecalculateForce();
771 m_showLabelChoice = choice;
772 }
773
774 bool PrintBrackets(bool print)
775 {
776 m_printBrackets = print;
777 return print;
778 }
779
781 bool AutodetectMaxima() const {return m_autodetectMaxima;}
783 void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
784
786 wxString MaximaParameters() const {return m_maximaParameters;}
788 void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
789
791 static wxString MaximaDefaultLocation();
792
794 wxString MaximaLocation() const;
795
797 wxString MaximaUserLocation() const {return m_maximaUserLocation;}
798
800 void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
801
803 bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
805 void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
806
808 bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
810 void InternalHelpBrowser(bool useInternalHelpBrowser)
811 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
812
814 bool SinglePageManual() const {return m_singlePageManual;}
816 void SinglePageManual(bool singlePageManual)
817 {m_singlePageManual = singlePageManual;}
818
820 wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
821
823 void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
824
831 static wxString FindProgram(const wxString &location);
832
835 { return m_fixReorderedIndices; }
836
837 void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
838
840 wxString MathJaXURL() const {
841 if(m_mathJaxURL_UseUser)
842 return m_mathJaxURL;
843 else
844 return MathJaXURL_Auto();}
845 wxString MathJaXURL_User() const { return m_mathJaxURL;}
846 bool MathJaXURL_UseUser() const { return m_mathJaxURL_UseUser;}
847 void MathJaXURL_UseUser(bool useUser){m_mathJaxURL_UseUser = useUser;}
848
849 bool EnterEvaluates() const {return m_enterEvaluates;}
850 void EnterEvaluates(bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
851 static wxString MathJaXURL_Auto() { return wxS("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
853 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
854
855 bool CopyBitmap() const {return m_copyBitmap;}
856 void CopyBitmap(bool copyBitmap){ m_copyBitmap = copyBitmap; }
857
858 bool CopyMathML() const {return m_copyMathML;}
859 void CopyMathML(bool copyMathML){ m_copyMathML = copyMathML;}
860 bool CopyMathMLHTML() const {return m_copyMathMLHTML;}
861 void CopyMathMLHTML(bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
862 bool HideMarkerForThisMessage(wxString message);
863 void HideMarkerForThisMessage(const wxString &message, bool hide)
864 {m_hideMarkerForThisMessage[message] = hide;}
865 bool CopyRTF() const {return m_copyRTF;}
866 void CopyRTF(bool copyRTF) { m_copyRTF = copyRTF; }
867 bool CopySVG() const {return m_copySVG;}
868 void CopySVG(bool copySVG) { m_copySVG = copySVG; }
869 bool CopyEMF() const {return m_copyEMF;}
870 void CopyEMF(bool copyEMF) { m_copyEMF = copyEMF; }
871 bool UseSVG() const {return m_useSVG;}
872 void UseSVG(bool useSVG) { m_useSVG = useSVG ;}
874 void ShowLength(long length) {
875 m_showLength = length;
876 }
878 long ShowLength() const {return m_showLength;}
880 std::size_t ShowLength_Bytes() const;
881
884 if(m_parenthesisDrawMode != mode)
885 RecalculateForce();
886 m_parenthesisDrawMode = mode;
887 }
888
889 void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
890
891 bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
892
893 void UseUnicodeMaths(bool useunicodemaths)
894 { m_useUnicodeMaths = useunicodemaths; }
895 bool UseUnicodeMaths() const {return m_useUnicodeMaths;}
896
897 StringBoolHash m_hideMarkerForThisMessage;
898
903 const Style *GetStyle(TextStyle textStyle) const { return &m_styles[textStyle]; }
911 Style *GetWritableStyle(TextStyle textStyle) { return &m_styles[textStyle]; }
912
914 wxWindow *GetWorkSheet() const {return m_workSheet;}
916 void SetWorkSheet(wxWindow *workSheet);
917
918 long DefaultPort() const {return m_defaultPort;}
919 void DefaultPort(long port){m_defaultPort = port;}
920 bool GetAbortOnError() const {return m_abortOnError;}
921 void SetAbortOnError(bool abortOnError) {m_abortOnError = abortOnError;}
922
923 long GetLanguage() const {return m_language;}
924 void SetLanguage(long language) {m_language = language;}
925
927 long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
928 void MaxGnuplotMegabytes(long megaBytes)
929 {m_maxGnuplotMegabytes = megaBytes;}
930
931 bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
932 void OfferKnownAnswers(bool offerKnownAnswers)
933 {m_offerKnownAnswers = offerKnownAnswers;}
934
935 wxString Documentclass() const {return m_documentclass;}
936 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
937 wxString DocumentclassOptions() const {return m_documentclassOptions;}
938 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
939
940
941 htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
942 void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
943 {m_htmlEquationFormat = HTMLequationFormat;}
944
945 AFontSize GetDefaultFontSize() const { return m_styles[TS_CODE_DEFAULT].GetFontSize(); }
946 AFontSize GetMathFontSize() const { return m_styles[TS_MATH].GetFontSize(); }
947
949 long GetAutosubscript_Num() const {return m_autoSubscript;}
950 void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
951 wxString GetAutosubscript_string() const;
953 wxColor DefaultBackgroundColor();
955 wxColor EditorBackgroundColor();
957 bool ClipToDrawRegion() const {return m_clipToDrawRegion;}
959 void ClipToDrawRegion(bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate = true;}
960 void SetVisibleRegion(wxRect visibleRegion){
961 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
962 RecalculateForce();
963 m_visibleRegion = visibleRegion;
964 }
965 wxRect GetVisibleRegion() const {return m_visibleRegion;}
966 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
967 wxPoint GetWorksheetPosition() const {return m_worksheetPosition;}
968 wxString MaximaShareDir() const {return m_maximaShareDir;}
969 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
970 wxString MaximaDemoDir() const {return m_maximaDemoDir;}
971 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
972 void InLispMode(bool lisp){m_inLispMode = lisp;}
973 bool InLispMode() const {return m_inLispMode;}
974 void BitmapScale(int factor){m_bitmapScale = factor;}
975 int BitmapScale() const {return m_bitmapScale;}
976 void DefaultPlotHeight(int px){m_defaultPlotHeight = px;}
977 int DefaultPlotHeight() const {return m_defaultPlotHeight;}
978 void DefaultPlotWidth(int px){m_defaultPlotWidth = px;}
979 int DefaultPlotWidth() const {return m_defaultPlotWidth;}
980 void DefaultFramerate(int fps){m_defaultFramerate = fps;}
981 int DefaultFramerate() const {return m_defaultFramerate;}
982 void TocDepth(int depth){m_tocDepth = depth;}
983 int TocDepth() const {return m_tocDepth;}
984 bool TeXExponentsAfterSubscript() const {return m_TeXExponentsAfterSubscript;}
985 void TeXExponentsAfterSubscript(bool ExponentsAfterSubscript)
986 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
987 bool UsePartialForDiff() const {return m_usePartialForDiff;}
988 void UsePartialForDiff(bool usePartialForDiff)
989 {m_usePartialForDiff = usePartialForDiff;}
991 void NotifyOfCellRedraw(const Cell *cell);
1001 void ReportMultipleRedraws();
1003 bool OfferInternalHelpBrowser() const;
1004 bool WrapLatexMath() const {return m_wrapLatexMath;}
1005 void WrapLatexMath(bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
1006 bool AllowNetworkHelp() const {return m_allowNetworkHelp;}
1007 void AllowNetworkHelp(bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
1008 bool ShowAllDigits() const {return m_showAllDigits;}
1009 void ShowAllDigits(bool shw){
1010 if(m_showAllDigits != shw)
1011 RecalculateForce();
1012 m_showAllDigits = shw;
1013 }
1014 bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
1015 void LineBreaksInLongNums(bool brk){
1016 if(m_lineBreaksInLongNums != brk)
1017 RecalculateForce();
1018 m_lineBreaksInLongNums = brk;
1019 }
1020 int MaxClipbrdBitmapMegabytes() const {return m_maxClipbrd_BitmapMegabytes;}
1021 void MaxClipbrdBitmapMegabytes(int maxClipbrd_BitmapMegabytes)
1022 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
1023
1024 void MaximaUsesHtmlBrowser(bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1025 bool MaximaUsesHtmlBrowser() const {return m_maximaUsesHhtmlBrowser;}
1026 void MaximaUsesWxmaximaBrowser(bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1027 bool MaximaUsesWxmaximaBrowser() const {return m_maximaUsesWxmaximaBrowser && OfferInternalHelpBrowser();}
1028 void ExportContainsWXMX(bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1029 bool ExportContainsWXMX() const {return m_exportContainsWXMX;}
1030 void WizardTab(long tab){m_wizardTab = tab;}
1031 long WizardTab() const {return m_wizardTab;}
1032
1033 void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1034 bool Display2d_Unicode() const {return m_display2d_Unicode;}
1035
1036 #ifdef __WXMSW__
1037 bool UseWGnuplot() const {return m_useWgnuplot;}
1038 void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1039 #endif
1040 wxString TexPreamble() const {return m_texPreamble;}
1041 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1042
1043 void SetMaximaVersion(const wxString &version){m_maximaVersion = version;}
1044 wxString GetMaximaVersion() const {return m_maximaVersion;}
1045 void SetMaximaArch(const wxString &arch){m_maximaArch = arch;}
1046 wxString GetMaximaArch() const {return m_maximaArch;}
1047 void SetLispVersion(const wxString &version){m_lispVersion = version;}
1048 wxString GetLispVersion() const {return m_lispVersion;}
1049 void SetLispType(const wxString &type){m_lispType = type;}
1050 wxString GetLispType() const {return m_lispType;}
1051
1052 Style m_styles[NUMBEROFSTYLES];
1054 void InitStyles();
1056 bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1057 wxTextCtrl *LastActiveTextCtrl() const { return m_lastActiveTextCtrl; }
1058 void LastActiveTextCtrl(wxTextCtrl *last);
1059
1061 const std::vector<TextStyle> &GetCodeStylesList() const {return m_codeStyles;}
1063 const std::vector<TextStyle> &GetMathStylesList() const {return m_2dMathStyles;}
1065 const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_colorOnlyStyles;}
1066 bool StyleAffectsCode(TextStyle style) const;
1067 bool StyleAffectsMathOut(TextStyle style) const;
1068 bool StyleAffectsColorOnly(TextStyle style) const;
1070 bool UpdateNeeded() const;
1072 static void SetDebugmode(){m_debugMode = true;}
1074 static bool GetDebugmode(){return m_debugMode;}
1075 maximaHelpFormat MaximaHelpFormat() const;
1076 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1077
1078private:
1079 wxString m_maximaArch;
1080 wxString m_lispVersion;
1081 wxString m_lispType;
1082 wxString m_maximaVersion;
1084 InitOpt m_initOpts;
1090 long m_configId;
1091public:
1093 std::random_device m_rd;
1095 std::default_random_engine m_eng;
1103 std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
1104 void RecalculateForce() { m_cellCfgCnt++; }
1105 static bool UseThreads(){return m_use_threads;}
1106 static void UseThreads(bool use){m_use_threads = use;}
1107 static void SetMaximaLang(const wxString &LANG){m_maxima_LANG = LANG;}
1108 static wxString GetMaximaLang(){return m_maxima_LANG;}
1109private:
1111 static wxString m_maxima_LANG;
1113 std::vector<TextStyle> m_codeStyles;
1115 std::vector<TextStyle> m_2dMathStyles;
1117 std::vector<TextStyle> m_colorOnlyStyles;
1118 std::list<FileToSave> m_filesToSave;
1119 RenderablecharsHash m_renderableChars;
1120 RenderablecharsHash m_nonRenderableChars;
1122 static bool FontDisplaysChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1124 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar, const wxFont &font = *wxNORMAL_FONT);
1125 mathDisplayMode m_displayMode = display_2d;
1126 using CellRedrawTrace = std::vector<const Cell*>;
1127 static bool m_debugMode;
1128 bool m_showInputLabels;
1129 long m_wizardTab;
1130 bool m_display2d_Unicode;
1131 bool m_usePartialForDiff;
1132 bool m_maximaUsesHhtmlBrowser;
1133 bool m_maximaUsesWxmaximaBrowser;
1135 bool m_autoSaveAsTempFile;
1137 long m_language;
1139 bool m_autodetectMaxima;
1141 bool m_autodetectHelpBrowser;
1143 bool m_useInternalHelpBrowser;
1145 bool m_singlePageManual;
1147 wxRect m_updateRegion;
1149 bool m_incrementalSearch;
1151 long m_autoSubscript;
1153 wxWindow *m_workSheet = NULL;
1155 std::unique_ptr<wxClientDC> m_worksheetDC;
1168// bool CharsExistInFont(const wxFont &font, const wxString& chars);
1170 bool m_wrapLatexMath;
1171 bool m_allowNetworkHelp;
1172 bool m_exportContainsWXMX;
1173 wxString m_texPreamble;
1174
1175 drawMode m_parenthesisDrawMode;
1176 wxString m_workingdir;
1177 bool m_TeXExponentsAfterSubscript;
1178 wxString m_helpBrowserUserLocation;
1179 wxString m_maximaUserLocation;
1181 bool m_hideBrackets;
1183 double m_printScale;
1184 double m_printMargin_Top;
1185 double m_printMargin_Bot;
1186 double m_printMargin_Left;
1187 double m_printMargin_Right;
1189 wxSize m_canvasSize;
1191 bool m_showBrackets;
1193 bool m_printBrackets;
1199 bool m_changeAsterisk;
1201 bool m_notifyIfIdle;
1203 long m_displayedDigits;
1205 long m_autoWrap;
1207 bool m_autoIndent;
1209 bool m_showAllDigits;
1211 bool m_lineBreaksInLongNums;
1213 bool m_matchParens;
1215 bool m_insertAns;
1217 bool m_openHCaret;
1219 long m_labelWidth;
1220 long m_indent;
1221 bool m_latin2greek;
1222 double m_zoomFactor;
1223 wxDC *m_dc;
1224 wxString m_maximaShareDir;
1225 wxString m_maximaDemoDir;
1226 bool m_forceUpdate;
1227 bool m_clipToDrawRegion = true;
1228 bool m_outdated;
1229 wxString m_maximaParameters;
1230 bool m_keepPercent;
1231 bool m_restartOnReEvaluation;
1232 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1233 bool m_printing;
1234 long m_lineWidth_em;
1235 showLabels m_showLabelChoice;
1236 bool m_fixReorderedIndices;
1237 wxString m_mathJaxURL;
1238 bool m_mathJaxURL_UseUser;
1239 bool m_showCodeCells;
1240 bool m_copyBitmap;
1241 bool m_copyMathML;
1242 bool m_copyMathMLHTML;
1243 long m_showLength;
1245 bool m_inLispMode;
1246 bool m_usepngCairo;
1247 bool m_enterEvaluates;
1248 bool m_useSVG;
1249 bool m_fixedFontTC;
1250 bool m_copyRTF;
1251 bool m_copySVG;
1252 bool m_copyEMF;
1253 bool m_TOCshowsSectionNumbers;
1254 bool m_useUnicodeMaths;
1255 bool m_indentMaths;
1256 bool m_abortOnError;
1257 bool m_showMatchingParens;
1258 bool m_hidemultiplicationsign;
1259 bool m_offerKnownAnswers;
1260 long m_defaultPort;
1261 long m_maxGnuplotMegabytes;
1262 long m_defaultPlotHeight;
1263 long m_defaultPlotWidth;
1264 bool m_saveUntitled;
1265 bool m_cursorJump;
1266 bool m_numpadEnterEvaluates;
1267 bool m_saveImgFileName;
1275 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1276 wxString m_documentclass;
1277 wxString m_documentclassOptions;
1278 htmlExportFormat m_htmlEquationFormat;
1280 wxRect m_visibleRegion;
1282 wxPoint m_worksheetPosition;
1283
1284 wxColour m_defaultBackgroundColor;
1286 wxBrush m_BackgroundBrush;
1287 wxBrush m_tooltipBrush;
1288 bool m_greekSidebar_ShowLatinLookalikes;
1289 #ifdef __WXMSW__
1290 bool m_useWgnuplot = false;
1291 #endif
1292 bool m_greekSidebar_Show_mu;
1293 wxString m_symbolPaneAdditionalChars;
1294 bool m_invertBackground;
1295 long m_undoLimit;
1296 long m_recentItems;
1297 int m_bitmapScale;
1298 int m_defaultFramerate;
1299 int m_tocDepth;
1300 int m_maxClipbrd_BitmapMegabytes;
1301 int m_autoSaveMinutes;
1302 int m_maxLayoutTime;
1303 wxString m_wxMathML_Filename;
1304 maximaHelpFormat m_maximaHelpFormat;
1305 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1306 std::atomic<std::int_fast32_t> m_cellCfgCnt{0};
1307 static bool m_use_threads;
1308};
1309
1312{
1313public:
1314 explicit Printing(Configuration *configuration)
1315 {
1316 m_configuration = configuration;
1317 m_configuration->SetPrinting(true);
1318 }
1319 virtual ~Printing()
1320 {
1321 m_configuration->SetPrinting(false);
1322 }
1323private:
1324 Configuration * m_configuration;
1325};
1326
1329{
1330public:
1331 explicit NoClipToDrawRegion(Configuration *configuration)
1332 {
1333 m_configuration = configuration;
1334 m_configuration->ClipToDrawRegion(false);
1335 }
1336 virtual ~NoClipToDrawRegion()
1337 {
1338 m_configuration->ClipToDrawRegion(true);
1339 }
1340private:
1341 Configuration * m_configuration;
1342};
1343
1344#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:97
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:142
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:648
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:664
The configuration storage for the current worksheet.
Definition: Configuration.h:86
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1555
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:299
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:820
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:1147
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:949
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:756
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:805
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1586
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:853
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:240
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1074
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:589
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:281
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:483
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:363
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:469
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1164
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1173
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:726
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1209
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:420
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:231
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:204
static const wxString & GetEscCode(const wxString &key)
Retrieve a symbol for the escape codes that can be typed after hitting the Escape key in the workshee...
Definition: Configuration.cpp:688
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:255
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:626
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:696
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:914
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1199
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1345
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:156
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:768
bool InUpdateRegion(wxRect rect) const
Whether any part of the given rectangle is within the current update region, or true if drawing is no...
Definition: Configuration.cpp:1577
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:524
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:814
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1845
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1063
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:1140
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:797
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:911
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:327
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1417
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:163
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:342
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1103
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:764
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:215
std::random_device m_rd
Our random device.
Definition: Configuration.h:1093
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:786
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:710
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:810
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:295
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:436
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:816
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:492
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1338
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:720
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:198
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:486
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:331
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:189
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:262
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:172
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:376
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:165
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:474
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:927
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:385
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:823
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:168
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:520
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1061
static const wxString CharsNeedingQuotes()
Returns a list of chars we need to escape in maxima.
Definition: Configuration.h:312
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:840
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:783
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:592
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1095
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:266
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:347
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:631
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1072
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:227
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:781
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:957
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1241
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:722
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:834
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:565
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:202
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:397
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1214
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:200
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:699
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:249
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:800
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1691
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:959
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1532
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:360
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:212
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:448
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:259
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:427
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1543
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:769
InitOpt
Definition: Configuration.h:138
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:140
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:808
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:883
drawMode
Definition: Configuration.h:132
@ ascii
Use ascii characters only.
Definition: Configuration.h:133
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:134
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:714
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:788
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1154
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:878
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:385
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1349
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:114
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:158
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:760
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1707
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1866
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:635
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:903
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:803
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:874
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:334
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1065
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:733
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1329
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1312
Text Style Definition.
Definition: TextStyle.h:63
AFontSize GetFontSize() const
The size of this style's font, asserted to be valid.
Definition: TextStyle.cpp:108
Definition: Configuration.h:412
Definition: Configuration.h:88