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#ifdef USE_WEBVIEW
43#include <wx/webview.h>
44#ifdef __WXMSW__
45#include <wx/msw/webview_ie.h>
46#endif
47#endif
48
49#define MC_LINE_SKIP Scale_Px(2)
50#define MC_TEXT_PADDING Scale_Px(1)
51
52#define PAREN_OPEN_TOP_UNICODE "\u239b"
53#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
54#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
55#define PAREN_CLOSE_TOP_UNICODE "\u239e"
56#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
57#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
58#define SUM_SIGN "\u2211"
59#define PROD_SIGN "\u220F"
61#define SUM_DEC 2
62
64#define MC_HCARET_WIDTH 25
65
66#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
67static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
68static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
69
70// The minimal and maximal label width
71#define LABELWIDTH_MIN 3
72#define LABELWIDTH_MAX 10
73class Cell;
74
90{
91public:
92 enum maximaHelpFormat{
93 maxima = 0,
94 frontend = 1,
95 browser = 2
96 };
99 {
100 mathJaX_TeX = 0,
101 bitmap = 1,
102 mathML_mathJaX = 2,
103 svg = 3,
104 html_export_invalidChoice
105 };
106
107 enum showLabels : int8_t
108 {
109 labels_automatic = 0,
110 labels_prefer_user = 1,
111 labels_useronly = 2,
112 labels_none = 3,
113 labels_invalidSelection
114 };
115
117 {
119 handdrawn
120 };
121
123 {
124 none,
125 temporary
126 };
127
128 enum mathDisplayMode
129 {
130 display_2d,
131 display_2dASCII,
132 display_2dUNICODE,
133 display_1dASCII
134 };
135
136 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
137 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
138 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
143 bool IsOperator(wxString name){return !(m_maximaOperators.find(name) == m_maximaOperators.end());}
144 const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
145 wxEnvVariableHashMap m_maximaEnvVars;
146
148 mathDisplayMode DisplayMode() const {return m_displayMode;}
150 void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
151
153 void SetWorkingDirectory(wxString dir)
154 { m_workingdir = std::move(dir); }
155
157 wxString GetWorkingDirectory() const
158 { return m_workingdir; }
159
161 void ReadConfig();
162
167 explicit Configuration(wxDC *dc = {}, InitOpt options = none);
168
170 void ResetAllToDefaults();
171
173 void SetRecalcContext(wxDC &dc)
174 {
175 m_dc = &dc;
176 }
177 void UnsetContext() {m_dc = NULL;}
178
180 void SetBackgroundBrush(const wxBrush &brush);
182 bool FixedFontInTextControls() const {return m_fixedFontTC;}
184 void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
186 wxBrush GetBackgroundBrush() const {return m_BackgroundBrush;}
188 wxBrush GetTooltipBrush() const {return m_tooltipBrush;}
189
190 virtual ~Configuration();
191
197
199 static std::unordered_map<TextStyle, wxString> m_styleNames;
200 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
201 using EscCodeIterator = EscCodeContainer::const_iterator;
202
204 static const wxString &GetEscCode(const wxString &key);
206 static EscCodeIterator EscCodesBegin();
208 static EscCodeIterator EscCodesEnd();
209
211 static double GetMinZoomFactor()
212 { return 0.1; }
213
215 static double GetMaxZoomFactor()
216 { return 32.0; }
217
224 double GetInterEquationSkip() const
225 {
227 return 0;
228 else
229 return GetZoomFactor() * m_styles[TS_MATH].GetFontSize() / 2;
230 }
231
233 wxCoord GetCellBracketWidth() const
234 {
235 return static_cast<wxCoord>(GetZoomFactor() * 16);
236 }
237
239 bool HideBrackets() const
240 { return m_hideBrackets; }
241
243 void HideBrackets(bool hide){m_hideBrackets = hide;}
244
246 double PrintScale() const
247 { return m_printScale; }
248
250 void PrintScale(double scale){m_printScale = scale;}
251
252 void PrintMargin_Top(double margin){m_printMargin_Top = margin;}
253 void PrintMargin_Bot(double margin){m_printMargin_Bot = margin;}
254 void PrintMargin_Left(double margin){m_printMargin_Left = margin;}
255 void PrintMargin_Right(double margin){m_printMargin_Right = margin;}
256 double PrintMargin_Top() const {return m_printMargin_Top;}
257 double PrintMargin_Bot() const {return m_printMargin_Bot;}
258 double PrintMargin_Left() const {return m_printMargin_Left;}
259 double PrintMargin_Right() const {return m_printMargin_Right;}
260
262 void SetZoomFactor(double newzoom);
263
265 void SetZoomFactor_temporarily(double newzoom){
266 if(m_zoomFactor != newzoom)
267 RecalculateForce();
268 m_zoomFactor = newzoom; ;
269 }
270
275 wxCoord Scale_Px(double px) const;
276 AFontSize Scale_Px(AFontSize size) const;
277
279 double GetZoomFactor() const
280 { return m_zoomFactor; }
281
283 wxDC *GetRecalcDC() const
284 { return m_dc; }
285
286 void SetRecalcDC(wxDC *dc)
287 { m_dc = dc; }
288
289 wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
290
291 // cppcheck-suppress functionStatic
292 // cppcheck-suppress functionConst
293 wxString GetSymbolFontName() const;
294
295 wxFontWeight IsBold(long st) const;
296
297 wxFontStyle IsItalic(long st) const;
298
299 bool IsUnderlined(long st) const {return m_styles[st].IsUnderlined();}
300
305 wxCoord GetLabelWidth() const
306 { return m_labelWidth * 14; }
307
309 long LabelWidth() const
310 { return m_labelWidth; }
312 void LabelWidth(long labelWidth)
313 {
314 if(m_labelWidth != labelWidth)
315 RecalculateForce();
316 m_labelWidth = labelWidth;
317 }
318
320 wxCoord GetIndent() const
321 {
322 if (m_indent < 0)
323 return 3 * GetCellBracketWidth() / 2;
324 else
325 return m_indent;
326 }
327
333 wxSize GetPPI() const;
334 int AutosaveMinutes() const {return m_autoSaveMinutes;}
335 void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
336
338 long GetCursorWidth() const
339 {
340 long ppi;
341
342 if(!m_printing)
343 ppi = GetPPI().x;
344 else
345 ppi = 96;
346
347 if (ppi / 45 < 1)
348 return 1;
349 else
350 return ppi / 45;
351 }
352
354 long GetBaseIndent() const
355 {
356 if (GetCursorWidth() < 12)
357 return 12;
358 else
359 return 4 + GetCursorWidth();
360 }
361
363 long GetGroupSkip() const
364 {
365 if (GetCursorWidth() < 10)
366 return 20;
367 else
368 return 10 + GetCursorWidth();
369 }
370
375 void SetIndent(long indent)
376 {
377 if(m_indent != indent)
378 RecalculateForce();
379 m_indent = indent;
380 }
381
382 bool IncrementalSearch() const {return m_incrementalSearch;}
383
384
385 void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
386
387 struct CharsExist {
388 wxString chars;
389 bool exist;
390 CharsExist(const wxString &chars, bool exist) : chars(chars), exist(exist) {}
391 };
392 std::vector<CharsExist> m_charsInFont;
393
396 {
397 m_charsInFont.clear();
398 RecalculateForce();
399 }
400
402 double GetDefaultLineWidth() const
403 {
404 if (GetZoomFactor() < 1.0)
405 return 1.0;
406 else
407 return GetZoomFactor();
408 }
409
411 long LineWidth_em() const
412 {
413 if(!m_printing)
414 return m_lineWidth_em;
415 else
416 return 10000;
417 }
418
419 bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
420 void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
421
423 void LineWidth_em(long width)
424 { m_lineWidth_em = width; }
425
427 // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
428 // But text blocks that are 1 meter wide and 2 cm high feel - weird.
429 long GetLineWidth() const;
430
431 bool SaveUntitled() const { return m_saveUntitled;}
432 void SaveUntitled(bool save) {m_saveUntitled = save;}
433
434 bool CursorJump() const { return m_cursorJump;}
435 void CursorJump(bool save){m_cursorJump = save;}
436
437 bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
438 void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
439
440 bool SaveImgFileName() const { return m_saveImgFileName;}
441 void SaveImgFileName(bool save) { m_saveImgFileName = save;}
442
444 bool GetAutoWrap() const
445 { return m_autoWrap > 0; }
446
447 // cppcheck-suppress functionStatic
449 static bool GetAutoWrapCode()
450 { return false; }
451
458 void SetAutoWrap(long autoWrap){m_autoWrap = autoWrap;}
459
461 bool GetAutoIndent() const
462 { return m_autoIndent; }
463
464 void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
465
467 bool IndentMaths() const {return m_indentMaths;}
468 void IndentMaths(bool indent){
469 if(m_indentMaths != indent)
470 RecalculateForce();
471 m_indentMaths = indent;}
472 AFontSize GetFontSize(TextStyle st) const { return m_styles[st].GetFontSize(); }
473
474 static const wxString &GetStyleName(TextStyle textStyle);
475
481 void ReadStyles(const wxString &file = {});
482
487 void WriteStyles(const wxString &file = {});
488 void WriteStyles(wxConfigBase *config);
489 void WriteSettings(const wxString &file = {});
490 void MakeStylesConsistent();
491 void Outdated(bool outdated)
492 { m_outdated = outdated; }
493
495 bool CheckKeepPercent() const
496 { return m_keepPercent; }
497
499 void SetKeepPercent(bool keepPercent)
500 {
501 if(m_keepPercent != keepPercent)
502 RecalculateForce();
503 m_keepPercent = keepPercent;
504 }
505
506 wxString GetTeXCMRI() const
507 { return m_fontCMRI; }
508
509 wxString GetTeXCMSY() const
510 { return m_fontCMSY; }
511
512 wxString GetTeXCMEX() const
513 { return m_fontCMEX; }
514
515 wxString GetTeXCMMI() const
516 { return m_fontCMMI; }
517
518 wxString GetTeXCMTI() const
519 { return m_fontCMTI; }
520
521 bool ShowCodeCells() const
522 { return m_showCodeCells; }
523
524 void ShowCodeCells(bool show);
525
532 void SetPrinting(bool printing);
533
540 bool GetPrinting() const
541 { return m_printing; }
542
544 wxColour GetColor(TextStyle style);
545
547 static wxColour InvertColour(wxColour col);
548
553 wxColor MakeColorDifferFromBackground(wxColor color);
554
555 bool UsePngCairo() const { return m_usepngCairo;}
556 void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
557
558 bool GetMatchParens() const { return m_matchParens; }
559 void SetMatchParens(bool matchParens) { m_matchParens = matchParens; }
560 bool ShowMatchingParens() const { return m_showMatchingParens; }
561 void ShowMatchingParens(bool show) { m_showMatchingParens = show; }
562
564 bool GetChangeAsterisk() const{ return m_changeAsterisk; }
565
567 void SetChangeAsterisk(bool changeAsterisk) {
568 if(m_changeAsterisk != changeAsterisk)
569 RecalculateForce();
570 m_changeAsterisk = changeAsterisk;
571 }
572
573 bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
574
575 void HidemultiplicationSign(bool show) {
576 if(m_hidemultiplicationsign != show)
577 RecalculateForce();
578 m_hidemultiplicationsign = show;
579 }
580
581 bool Latin2Greek() const
582 {return m_latin2greek;}
583
584 void Latin2Greek(bool latin2greek) {
585 if(m_latin2greek != latin2greek)
586 RecalculateForce();
587 m_latin2greek = latin2greek;
588 }
589
590 bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
591 void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
592
593 bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
594 void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
595
596 wxString SymbolPaneAdditionalChars() const
597 {return m_symbolPaneAdditionalChars;}
598 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
599
601 bool NotifyIfIdle() const
602 { return m_notifyIfIdle; }
603
604 void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
605
611 { return m_displayedDigits; }
612
613 void SetDisplayedDigits(long displayedDigits)
614 {
615 wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
616 if(m_displayedDigits != displayedDigits)
617 RecalculateForce();
618 m_displayedDigits = displayedDigits;
619 }
620
623 {
624 public:
625 FileToSave(const wxString &filename, const wxMemoryBuffer &data):
626 m_data(data),
627 m_filename(filename)
628 {
629 }
630 const wxString FileName() const{return m_filename;}
631 const wxMemoryBuffer Data() const{return m_data;}
632 private:
633 const wxMemoryBuffer m_data;
634 const wxString m_filename;
635 };
636
639 {
640 public:
641 TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
642 m_pos(pos),
643 m_text(text),
644 m_color(color)
645 {
646 }
647 const wxPoint Pos() const{return m_pos;}
648 const wxString Text() const{return m_text;}
649 const wxColor Color() const{return m_color;}
650 private:
651 const wxPoint m_pos;
652 const wxString m_text;
653 const wxColor m_color;
654 };
655
656 FileToSave PopFileToSave();
657 void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
658 { m_filesToSave.emplace_front(FileToSave(filename, data)); }
659
660 wxRect GetUpdateRegion() const {return m_updateRegion;}
661 const std::list<FileToSave> &GetFilesToSave() const {return m_filesToSave;}
662 void ClearFilesToSave () { m_filesToSave.clear();}
663 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
664
667 bool InUpdateRegion(wxRect rect) const;
668
669 bool GetInsertAns() const
670 { return m_insertAns; }
671
672 void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
673
674 bool GetOpenHCaret() const
675 { return m_openHCaret; }
676
677 void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
678
679 bool RestartOnReEvaluation() const
680 { return m_restartOnReEvaluation; }
681
682 void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
683
685 wxSize GetCanvasSize() const
686 { return m_canvasSize; }
687
689 void SetCanvasSize(wxSize siz)
690 {
691 if(m_canvasSize.GetWidth() != siz.GetWidth())
692 RecalculateForce();
693 m_canvasSize = siz;
694 }
695
697 bool ShowBrackets() const
698 { return m_showBrackets; }
699
700 bool ShowBrackets(bool show)
701 {
702 if(m_showBrackets != show)
703 RecalculateForce();
704 return m_showBrackets = show;
705 }
706
708 bool PrintBrackets() const
709 { return m_printBrackets; }
710
711 showLabels GetLabelChoice() const
712 { return m_showLabelChoice; }
713
714 bool ShowInputLabels() const {return m_showInputLabels;}
715 void ShowInputLabels(bool show) {
716 if(m_showInputLabels != show)
717 RecalculateForce();
718 m_showInputLabels = show;
719 }
720
721 bool InvertBackground() const {return m_invertBackground;}
722 void InvertBackground(bool invert){ m_invertBackground = invert; }
723
724 long UndoLimit(){return std::max(m_undoLimit, static_cast<long>(0));}
725 void UndoLimit(long limit){ m_undoLimit = limit; }
726
727 long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
728 void RecentItems(long items){ m_recentItems = items; }
729
732 { return (m_showLabelChoice < labels_useronly); }
733
735 bool UseUserLabels() const
736 { return m_showLabelChoice > labels_automatic; }
737
739 bool ShowLabels() const
740 { return m_showLabelChoice < labels_none; }
741
743 void SetLabelChoice(showLabels choice) {
744 if(m_showLabelChoice != choice)
745 RecalculateForce();
746 m_showLabelChoice = choice;
747 }
748
749 bool PrintBrackets(bool print)
750 {
751 m_printBrackets = print;
752 return print;
753 }
754
756 bool AutodetectMaxima() const {return m_autodetectMaxima;}
758 void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
759
761 wxString MaximaParameters() const {return m_maximaParameters;}
763 void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
764
766 static wxString MaximaDefaultLocation();
767
769 wxString MaximaLocation() const;
770
772 wxString MaximaUserLocation() const {return m_maximaUserLocation;}
773
775 void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
776
778 bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
780 void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
781
783 bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
785 void InternalHelpBrowser(bool useInternalHelpBrowser)
786 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
787
789 bool SinglePageManual() const {return m_singlePageManual;}
791 void SinglePageManual(bool singlePageManual)
792 {m_singlePageManual = singlePageManual;}
793
795 wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
796
798 void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
799
806 static wxString FindProgram(const wxString &location);
807
810 { return m_fixReorderedIndices; }
811
812 void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
813
815 wxString MathJaXURL() const {
816 if(m_mathJaxURL_UseUser)
817 return m_mathJaxURL;
818 else
819 return MathJaXURL_Auto();}
820 wxString MathJaXURL_User() const { return m_mathJaxURL;}
821 bool MathJaXURL_UseUser() const { return m_mathJaxURL_UseUser;}
822 void MathJaXURL_UseUser(bool useUser){m_mathJaxURL_UseUser = useUser;}
823
824 bool EnterEvaluates() const {return m_enterEvaluates;}
825 void EnterEvaluates(bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
826 static wxString MathJaXURL_Auto() { return wxS("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
828 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
829
830 bool CopyBitmap() const {return m_copyBitmap;}
831 void CopyBitmap(bool copyBitmap){ m_copyBitmap = copyBitmap; }
832
833 bool CopyMathML() const {return m_copyMathML;}
834 void CopyMathML(bool copyMathML){ m_copyMathML = copyMathML;}
835 bool CopyMathMLHTML() const {return m_copyMathMLHTML;}
836 void CopyMathMLHTML(bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
837 bool HideMarkerForThisMessage(wxString message);
838 void HideMarkerForThisMessage(const wxString &message, bool hide)
839 {m_hideMarkerForThisMessage[message] = hide;}
840 bool CopyRTF() const {return m_copyRTF;}
841 void CopyRTF(bool copyRTF) { m_copyRTF = copyRTF; }
842 bool CopySVG() const {return m_copySVG;}
843 void CopySVG(bool copySVG) { m_copySVG = copySVG; }
844 bool CopyEMF() const {return m_copyEMF;}
845 void CopyEMF(bool copyEMF) { m_copyEMF = copyEMF; }
846 bool UseSVG() const {return m_useSVG;}
847 void UseSVG(bool useSVG) { m_useSVG = useSVG ;}
849 void ShowLength(long length) {
850 m_showLength = length;
851 }
853 long ShowLength() const {return m_showLength;}
855 std::size_t ShowLength_Bytes() const;
856
859 if(m_parenthesisDrawMode != mode)
860 RecalculateForce();
861 m_parenthesisDrawMode = mode;
862 }
863
864 void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
865
866 bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
867
868 void UseUnicodeMaths(bool useunicodemaths)
869 { m_useUnicodeMaths = useunicodemaths; }
870 bool UseUnicodeMaths() const {return m_useUnicodeMaths;}
871
872 StringBoolHash m_hideMarkerForThisMessage;
873
878 const Style *GetStyle(TextStyle textStyle) const { return &m_styles[textStyle]; }
886 Style *GetWritableStyle(TextStyle textStyle) { return &m_styles[textStyle]; }
887
889 wxWindow *GetWorkSheet() const {return m_workSheet;}
891 void SetWorkSheet(wxWindow *workSheet);
892
893 long DefaultPort() const {return m_defaultPort;}
894 void DefaultPort(long port){m_defaultPort = port;}
895 bool GetAbortOnError() const {return m_abortOnError;}
896 void SetAbortOnError(bool abortOnError) {m_abortOnError = abortOnError;}
897
898 long GetLanguage() const {return m_language;}
899 void SetLanguage(long language) {m_language = language;}
900
902 long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
903 void MaxGnuplotMegabytes(long megaBytes)
904 {m_maxGnuplotMegabytes = megaBytes;}
905
906 bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
907 void OfferKnownAnswers(bool offerKnownAnswers)
908 {m_offerKnownAnswers = offerKnownAnswers;}
909
910 wxString Documentclass() const {return m_documentclass;}
911 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
912 wxString DocumentclassOptions() const {return m_documentclassOptions;}
913 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
914
915
916 htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
917 void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
918 {m_htmlEquationFormat = HTMLequationFormat;}
919
920 AFontSize GetDefaultFontSize() const { return m_styles[TS_CODE_DEFAULT].GetFontSize(); }
921 AFontSize GetMathFontSize() const { return m_styles[TS_MATH].GetFontSize(); }
922
924 long GetAutosubscript_Num() const {return m_autoSubscript;}
925 void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
926 wxString GetAutosubscript_string() const;
928 wxColor DefaultBackgroundColor();
930 wxColor EditorBackgroundColor();
932 bool ClipToDrawRegion() const {return m_clipToDrawRegion;}
934 void ClipToDrawRegion(bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate = true;}
935 void SetVisibleRegion(wxRect visibleRegion){
936 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
937 RecalculateForce();
938 m_visibleRegion = visibleRegion;
939 }
940 wxRect GetVisibleRegion() const {return m_visibleRegion;}
941 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
942 wxPoint GetWorksheetPosition() const {return m_worksheetPosition;}
943 wxString MaximaShareDir() const {return m_maximaShareDir;}
944 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
945 wxString MaximaDemoDir() const {return m_maximaDemoDir;}
946 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
947 void InLispMode(bool lisp){m_inLispMode = lisp;}
948 bool InLispMode() const {return m_inLispMode;}
949 void BitmapScale(int factor){m_bitmapScale = factor;}
950 int BitmapScale() const {return m_bitmapScale;}
951 void DefaultPlotHeight(int px){m_defaultPlotHeight = px;}
952 int DefaultPlotHeight() const {return m_defaultPlotHeight;}
953 void DefaultPlotWidth(int px){m_defaultPlotWidth = px;}
954 int DefaultPlotWidth() const {return m_defaultPlotWidth;}
955 void DefaultFramerate(int fps){m_defaultFramerate = fps;}
956 int DefaultFramerate() const {return m_defaultFramerate;}
957 void TocDepth(int depth){m_tocDepth = depth;}
958 int TocDepth() const {return m_tocDepth;}
959 bool TeXExponentsAfterSubscript() const {return m_TeXExponentsAfterSubscript;}
960 void TeXExponentsAfterSubscript(bool ExponentsAfterSubscript)
961 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
962 bool UsePartialForDiff() const {return m_usePartialForDiff;}
963 void UsePartialForDiff(bool usePartialForDiff)
964 {m_usePartialForDiff = usePartialForDiff;}
966 void NotifyOfCellRedraw(const Cell *cell);
978 bool OfferInternalHelpBrowser() const;
979 bool WrapLatexMath() const {return m_wrapLatexMath;}
980 void WrapLatexMath(bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
981 bool AllowNetworkHelp() const {return m_allowNetworkHelp;}
982 void AllowNetworkHelp(bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
983 bool ShowAllDigits() const {return m_showAllDigits;}
984 void ShowAllDigits(bool shw){
985 if(m_showAllDigits != shw)
986 RecalculateForce();
987 m_showAllDigits = shw;
988 }
989 bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
990 void LineBreaksInLongNums(bool brk){
991 if(m_lineBreaksInLongNums != brk)
992 RecalculateForce();
993 m_lineBreaksInLongNums = brk;
994 }
995 int MaxClipbrdBitmapMegabytes() const {return m_maxClipbrd_BitmapMegabytes;}
996 void MaxClipbrdBitmapMegabytes(int maxClipbrd_BitmapMegabytes)
997 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
998
999 void MaximaUsesHtmlBrowser(bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1000 bool MaximaUsesHtmlBrowser() const {return m_maximaUsesHhtmlBrowser;}
1001 void MaximaUsesWxmaximaBrowser(bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1002 bool MaximaUsesWxmaximaBrowser() const {return m_maximaUsesWxmaximaBrowser && OfferInternalHelpBrowser();}
1003 void ExportContainsWXMX(bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1004 bool ExportContainsWXMX() const {return m_exportContainsWXMX;}
1005 void WizardTab(long tab){m_wizardTab = tab;}
1006 long WizardTab() const {return m_wizardTab;}
1007
1008 void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1009 bool Display2d_Unicode() const {return m_display2d_Unicode;}
1010
1011 #ifdef __WXMSW__
1012 bool UseWGnuplot() const {return m_useWgnuplot;}
1013 void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1014 #endif
1015 wxString TexPreamble() const {return m_texPreamble;}
1016 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1017
1018 void SetMaximaVersion(const wxString &version){m_maximaVersion = version;}
1019 wxString GetMaximaVersion() const {return m_maximaVersion;}
1020 void SetMaximaArch(const wxString &arch){m_maximaArch = arch;}
1021 wxString GetMaximaArch() const {return m_maximaArch;}
1022 void SetLispVersion(const wxString &version){m_lispVersion = version;}
1023 wxString GetLispVersion() const {return m_lispVersion;}
1024 void SetLispType(const wxString &type){m_lispType = type;}
1025 wxString GetLispType() const {return m_lispType;}
1026
1027 Style m_styles[NUMBEROFSTYLES];
1029 void InitStyles();
1031 bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1032 wxTextCtrl *LastActiveTextCtrl() const { return m_lastActiveTextCtrl; }
1033 void LastActiveTextCtrl(wxTextCtrl *last);
1034
1036 const std::vector<TextStyle> &GetCodeStylesList() const {return m_codeStyles;}
1038 const std::vector<TextStyle> &GetMathStylesList() const {return m_2dMathStyles;}
1040 const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_colorOnlyStyles;}
1041 bool StyleAffectsCode(TextStyle style) const;
1042 bool StyleAffectsMathOut(TextStyle style) const;
1043 bool StyleAffectsColorOnly(TextStyle style) const;
1045 bool UpdateNeeded() const;
1047 static void SetDebugmode(){m_debugMode = true;}
1049 static bool GetDebugmode(){return m_debugMode;}
1050 maximaHelpFormat MaximaHelpFormat() const;
1051 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1052
1053private:
1054 wxString m_maximaArch;
1055 wxString m_lispVersion;
1056 wxString m_lispType;
1057 wxString m_maximaVersion;
1059 InitOpt m_initOpts;
1065 long m_configId;
1066public:
1068 std::random_device m_rd;
1070 std::default_random_engine m_eng;
1078 std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
1079 void RecalculateForce() { m_cellCfgCnt++; }
1080 static bool UseThreads(){return m_use_threads;}
1081 static void UseThreads(bool use){m_use_threads = use;}
1082 static void SetMaximaLang(const wxString &LANG){m_maxima_LANG = LANG;}
1083 static wxString GetMaximaLang(){return m_maxima_LANG;}
1084private:
1086 static wxString m_maxima_LANG;
1088 std::vector<TextStyle> m_codeStyles;
1090 std::vector<TextStyle> m_2dMathStyles;
1092 std::vector<TextStyle> m_colorOnlyStyles;
1093 std::list<FileToSave> m_filesToSave;
1094 RenderablecharsHash m_renderableChars;
1095 RenderablecharsHash m_nonRenderableChars;
1097 static bool FontDisplaysChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1099 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar, const wxFont &font = *wxNORMAL_FONT);
1100 mathDisplayMode m_displayMode = display_2d;
1101 using CellRedrawTrace = std::vector<const Cell*>;
1102 static bool m_debugMode;
1103 bool m_showInputLabels;
1104 long m_wizardTab;
1105 bool m_display2d_Unicode;
1106 bool m_usePartialForDiff;
1107 bool m_maximaUsesHhtmlBrowser;
1108 bool m_maximaUsesWxmaximaBrowser;
1110 bool m_autoSaveAsTempFile;
1112 long m_language;
1114 bool m_autodetectMaxima;
1116 bool m_autodetectHelpBrowser;
1118 bool m_useInternalHelpBrowser;
1120 bool m_singlePageManual;
1122 wxRect m_updateRegion;
1124 bool m_incrementalSearch;
1126 long m_autoSubscript;
1128 wxWindow *m_workSheet = NULL;
1130 std::unique_ptr<wxClientDC> m_worksheetDC;
1143// bool CharsExistInFont(const wxFont &font, const wxString& chars);
1145 bool m_wrapLatexMath;
1146 bool m_allowNetworkHelp;
1147 bool m_exportContainsWXMX;
1148 wxString m_texPreamble;
1149
1150 drawMode m_parenthesisDrawMode;
1151 wxString m_workingdir;
1152 bool m_TeXExponentsAfterSubscript;
1153 wxString m_helpBrowserUserLocation;
1154 wxString m_maximaUserLocation;
1156 bool m_hideBrackets;
1158 double m_printScale;
1159 double m_printMargin_Top;
1160 double m_printMargin_Bot;
1161 double m_printMargin_Left;
1162 double m_printMargin_Right;
1164 wxSize m_canvasSize;
1166 bool m_showBrackets;
1168 bool m_printBrackets;
1174 bool m_changeAsterisk;
1176 bool m_notifyIfIdle;
1178 long m_displayedDigits;
1180 long m_autoWrap;
1182 bool m_autoIndent;
1184 bool m_showAllDigits;
1186 bool m_lineBreaksInLongNums;
1188 bool m_matchParens;
1190 bool m_insertAns;
1192 bool m_openHCaret;
1194 long m_labelWidth;
1195 long m_indent;
1196 bool m_latin2greek;
1197 double m_zoomFactor;
1198 wxDC *m_dc;
1199 wxString m_maximaShareDir;
1200 wxString m_maximaDemoDir;
1201 bool m_forceUpdate;
1202 bool m_clipToDrawRegion = true;
1203 bool m_outdated;
1204 wxString m_maximaParameters;
1205 bool m_keepPercent;
1206 bool m_restartOnReEvaluation;
1207 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1208 bool m_printing;
1209 long m_lineWidth_em;
1210 showLabels m_showLabelChoice;
1211 bool m_fixReorderedIndices;
1212 wxString m_mathJaxURL;
1213 bool m_mathJaxURL_UseUser;
1214 bool m_showCodeCells;
1215 bool m_copyBitmap;
1216 bool m_copyMathML;
1217 bool m_copyMathMLHTML;
1218 long m_showLength;
1220 bool m_inLispMode;
1221 bool m_usepngCairo;
1222 bool m_enterEvaluates;
1223 bool m_useSVG;
1224 bool m_fixedFontTC;
1225 bool m_copyRTF;
1226 bool m_copySVG;
1227 bool m_copyEMF;
1228 bool m_TOCshowsSectionNumbers;
1229 bool m_useUnicodeMaths;
1230 bool m_indentMaths;
1231 bool m_abortOnError;
1232 bool m_showMatchingParens;
1233 bool m_hidemultiplicationsign;
1234 bool m_offerKnownAnswers;
1235 long m_defaultPort;
1236 long m_maxGnuplotMegabytes;
1237 long m_defaultPlotHeight;
1238 long m_defaultPlotWidth;
1239 bool m_saveUntitled;
1240 bool m_cursorJump;
1241 bool m_numpadEnterEvaluates;
1242 bool m_saveImgFileName;
1250 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1251 wxString m_documentclass;
1252 wxString m_documentclassOptions;
1253 htmlExportFormat m_htmlEquationFormat;
1255 wxRect m_visibleRegion;
1257 wxPoint m_worksheetPosition;
1258
1259 wxColour m_defaultBackgroundColor;
1261 wxBrush m_BackgroundBrush;
1262 wxBrush m_tooltipBrush;
1263 bool m_greekSidebar_ShowLatinLookalikes;
1264 #ifdef __WXMSW__
1265 bool m_useWgnuplot = false;
1266 #endif
1267 bool m_greekSidebar_Show_mu;
1268 wxString m_symbolPaneAdditionalChars;
1269 bool m_invertBackground;
1270 long m_undoLimit;
1271 long m_recentItems;
1272 int m_bitmapScale;
1273 int m_defaultFramerate;
1274 int m_tocDepth;
1275 int m_maxClipbrd_BitmapMegabytes;
1276 int m_autoSaveMinutes;
1277 wxString m_wxMathML_Filename;
1278 maximaHelpFormat m_maximaHelpFormat;
1279 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1280 std::int_fast32_t m_cellCfgCnt = 0;
1281 static bool m_use_threads;
1282};
1283
1286{
1287public:
1288 explicit Printing(Configuration *configuration)
1289 {
1290 m_configuration = configuration;
1291 m_configuration->SetPrinting(true);
1292 }
1293 virtual ~Printing()
1294 {
1295 m_configuration->SetPrinting(false);
1296 }
1297private:
1298 Configuration * m_configuration;
1299};
1300
1303{
1304public:
1305 explicit NoClipToDrawRegion(Configuration *configuration)
1306 {
1307 m_configuration = configuration;
1308 m_configuration->ClipToDrawRegion(false);
1309 }
1310 virtual ~NoClipToDrawRegion()
1311 {
1312 m_configuration->ClipToDrawRegion(true);
1313 }
1314private:
1315 Configuration * m_configuration;
1316};
1317
1318#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:623
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:639
The configuration storage for the current worksheet.
Definition: Configuration.h:90
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1406
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:283
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:795
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:999
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:924
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:731
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:780
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1437
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:828
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:224
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1049
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:564
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:265
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:458
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:219
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:444
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1016
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1025
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:581
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1061
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:395
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:215
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:188
static const wxString & GetEscCode(const wxString &key)
Retrieve a symbol for the escape codes that can be typed after hitting the Escape key in the workshee...
Definition: Configuration.cpp:543
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:239
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:601
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:551
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:889
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1051
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1197
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:141
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:743
bool InUpdateRegion(wxRect rect) const
Whether any part of the given rectangle is within the current update region, or true if drawing is no...
Definition: Configuration.cpp:1428
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:499
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:789
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1696
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1038
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:992
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:772
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:886
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:305
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1269
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:148
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:320
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1078
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:739
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:199
std::random_device m_rd
Our random device.
Definition: Configuration.h:1068
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:761
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:685
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:785
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:279
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:411
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:791
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:467
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1190
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:575
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:182
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:461
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:309
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:173
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:246
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:157
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:354
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:150
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:449
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:902
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:363
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:798
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:153
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:495
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1036
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:815
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:758
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:567
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1070
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:250
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:203
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:486
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1047
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:211
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:756
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:932
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1093
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:697
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:809
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:540
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:186
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:375
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1066
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:184
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:554
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1394
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:233
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:775
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1542
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:934
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1383
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:338
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:196
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:423
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:243
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:402
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:624
InitOpt
Definition: Configuration.h:123
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:125
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:783
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:858
drawMode
Definition: Configuration.h:117
@ ascii
Use ascii characters only.
Definition: Configuration.h:118
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:119
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:689
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:763
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1006
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:853
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:241
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1201
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:99
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:143
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:735
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1558
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1717
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:610
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:878
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:778
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:849
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:312
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1040
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:708
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1303
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1286
Text Style Definition.
Definition: TextStyle.h:63
AFontSize GetFontSize() const
The size of this style's font, asserted to be valid.
Definition: TextStyle.cpp:101
Definition: Configuration.h:387