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