wxMaxima
Loading...
Searching...
No Matches
Configuration.h
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
22#ifndef CONFIGURATION_H
23#define CONFIGURATION_H
24
25#include "precomp.h"
26#include <wx/wx.h>
27#include <wx/config.h>
28#include <wx/display.h>
29#include <wx/fontenum.h>
30#include <wx/hashmap.h>
32#include "cells/TextStyle.h"
33#include <cstdint>
34#include <memory>
35#include <mutex>
36#include <unordered_map>
37#include <random>
38#include <list>
39#include <vector>
40#include <algorithm>
41#include <atomic>
42#include <wx/wupdlock.h>
43
44#define MC_LINE_SKIP Scale_Px(2)
45#define MC_TEXT_PADDING Scale_Px(1)
46
47#define PAREN_OPEN_TOP_UNICODE "\u239b"
48#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
49#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
50#define PAREN_CLOSE_TOP_UNICODE "\u239e"
51#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
52#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
53#define SUM_SIGN "\u2211"
54#define PROD_SIGN "\u220F"
56#define SUM_DEC 2
57
59#define MC_HCARET_WIDTH 25
60
61#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
62static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
63static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
64
65// The minimal and maximal label width
66#define LABELWIDTH_MIN 3
67#define LABELWIDTH_MAX 10
68class Cell;
69
85{
86public:
87 enum maximaHelpFormat{
88 maxima = 0,
89 frontend = 1,
90 browser = 2
91 };
94 {
95 mathJaX_TeX = 0,
96 bitmap = 1,
97 mathML_mathJaX = 2,
98 svg = 3,
99 html_export_invalidChoice
100 };
101
102 enum showLabels : int8_t
103 {
104 labels_automatic = 0,
105 labels_prefer_user = 1,
106 labels_useronly = 2,
107 labels_none = 3,
108 labels_invalidSelection
109 };
110
112 {
114 handdrawn
115 };
116
118 {
119 none,
120 temporary
121 };
122
123 enum mathDisplayMode
124 {
125 display_2d,
126 display_2dASCII,
127 display_2dUNICODE,
128 display_1dASCII
129 };
130
131 typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
132 typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
133 typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
138 bool IsOperator(wxString name){return !(m_maximaOperators.find(name) == m_maximaOperators.end());}
139 const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
140 wxEnvVariableHashMap m_maximaEnvVars;
141
143 mathDisplayMode DisplayMode() const {return m_displayMode;}
145 void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
146
148 void SetWorkingDirectory(wxString dir)
149 { m_workingdir = std::move(dir); }
150
152 wxString GetWorkingDirectory() const
153 { return m_workingdir; }
154
156 void ReadConfig();
157
162 explicit Configuration(wxDC *dc = {}, InitOpt options = none);
163
165 void ResetAllToDefaults();
166
168 void SetRecalcContext(wxDC &dc)
169 {
170 m_dc = &dc;
171 }
172 void UnsetContext() {m_dc = NULL;}
173
175 void SetBackgroundBrush(const wxBrush &brush);
177 bool FixedFontInTextControls() const {return m_fixedFontTC;}
179 void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
181 wxBrush GetBackgroundBrush() const {return m_BackgroundBrush;}
183 wxBrush GetTooltipBrush() const {return m_tooltipBrush;}
184
185 virtual ~Configuration();
186
192
194 static std::unordered_map<TextStyle, wxString> m_styleNames;
195 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
196 using EscCodeIterator = EscCodeContainer::const_iterator;
197
199 static const wxString &GetEscCode(const wxString &key);
201 static EscCodeIterator EscCodesBegin();
203 static EscCodeIterator EscCodesEnd();
204
206 static double GetMinZoomFactor()
207 { return 0.1; }
208
210 static double GetMaxZoomFactor()
211 { return 32.0; }
212
219 double GetInterEquationSkip() const
220 {
222 return 0;
223 else
224 return GetZoomFactor() * m_styles[TS_MATH].GetFontSize() / 2;
225 }
226
228 wxCoord GetCellBracketWidth() const
229 {
230 return static_cast<wxCoord>(GetZoomFactor() * 16);
231 }
232
234 bool HideBrackets() const
235 { return m_hideBrackets; }
236
238 void HideBrackets(bool hide){m_hideBrackets = hide;}
239
241 double PrintScale() const
242 { return m_printScale; }
243
245 void PrintScale(double scale){m_printScale = scale;}
246
247 void PrintMargin_Top(double margin){m_printMargin_Top = margin;}
248 void PrintMargin_Bot(double margin){m_printMargin_Bot = margin;}
249 void PrintMargin_Left(double margin){m_printMargin_Left = margin;}
250 void PrintMargin_Right(double margin){m_printMargin_Right = margin;}
251 double PrintMargin_Top() const {return m_printMargin_Top;}
252 double PrintMargin_Bot() const {return m_printMargin_Bot;}
253 double PrintMargin_Left() const {return m_printMargin_Left;}
254 double PrintMargin_Right() const {return m_printMargin_Right;}
255
257 void SetZoomFactor(double newzoom);
258
260 void SetZoomFactor_temporarily(double newzoom){
261 if(m_zoomFactor != newzoom)
262 RecalculateForce();
263 m_zoomFactor = newzoom;
264 }
265
270 wxCoord Scale_Px(double px) const;
271 AFontSize Scale_Px(AFontSize size) const;
272
274 double GetZoomFactor() const
275 { return m_zoomFactor; }
276
278 wxDC *GetRecalcDC() const
279 { return m_dc; }
280
281 void SetRecalcDC(wxDC *dc)
282 { m_dc = dc; }
283
284 wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
285
286 // cppcheck-suppress functionStatic
287 // cppcheck-suppress functionConst
288 wxString GetSymbolFontName() const;
289
291 static const wxString CharsNeedingQuotes()
292 {
293 return wxString(wxS("°,\\'\"()[]-{}^+*/&§?:;=#<>$"));
294 }
295
296 wxFontWeight IsBold(long st) const;
297
298 wxFontStyle IsItalic(long st) const;
299
300 bool IsUnderlined(long st) const {return m_styles[st].IsUnderlined();}
301
306 wxCoord GetLabelWidth() const
307 { return m_labelWidth * 14; }
308
310 long LabelWidth() const
311 { return m_labelWidth; }
313 void LabelWidth(long labelWidth)
314 {
315 if(m_labelWidth != labelWidth)
316 RecalculateForce();
317 m_labelWidth = labelWidth;
318 }
319
321 wxCoord GetIndent() const
322 {
323 if (m_indent < 0)
324 return 3 * GetCellBracketWidth() / 2;
325 else
326 return m_indent;
327 }
328
334 wxSize GetPPI() const;
335 int AutosaveMinutes() const {return m_autoSaveMinutes;}
336 void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
337
339 long GetCursorWidth() const
340 {
341 long ppi;
342
343 if(!m_printing)
344 ppi = GetPPI().x;
345 else
346 ppi = 96;
347
348 if (ppi / 45 < 1)
349 return 1;
350 else
351 return ppi / 45;
352 }
353
355 long GetBaseIndent() const
356 {
357 if (GetCursorWidth() < 12)
358 return 12;
359 else
360 return 4 + GetCursorWidth();
361 }
362
364 long GetGroupSkip() const
365 {
366 if (GetCursorWidth() < 10)
367 return 20;
368 else
369 return 10 + GetCursorWidth();
370 }
371
376 void SetIndent(long indent)
377 {
378 if(m_indent != indent)
379 RecalculateForce();
380 m_indent = indent;
381 }
382
383 bool IncrementalSearch() const {return m_incrementalSearch;}
384
385
386 void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
387
388 int MaxLayoutTime() const { return m_maxLayoutTime; }
389 void MaxLayoutTime(int time) { m_maxLayoutTime = time; }
390
391 struct CharsExist {
392 wxString chars;
393 bool exist;
394 CharsExist(const wxString &chars, bool exist) : chars(chars), exist(exist) {}
395 };
396 std::vector<CharsExist> m_charsInFont;
397
400 {
401 m_charsInFont.clear();
402 RecalculateForce();
403 }
404
406 double GetDefaultLineWidth() const
407 {
408 if (GetZoomFactor() < 1.0)
409 return 1.0;
410 else
411 return GetZoomFactor();
412 }
413
415 long LineWidth_em() const
416 {
417 if(!m_printing)
418 return m_lineWidth_em;
419 else
420 return 10000;
421 }
422
423 bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
424 void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
425
427 void LineWidth_em(long width)
428 { m_lineWidth_em = width; }
429
431 // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
432 // But text blocks that are 1 meter wide and 2 cm high feel - weird.
433 long GetLineWidth() const;
434
435 bool SaveUntitled() const { return m_saveUntitled;}
436 void SaveUntitled(bool save) {m_saveUntitled = save;}
437
438 bool CursorJump() const { return m_cursorJump;}
439 void CursorJump(bool save){m_cursorJump = save;}
440
441 bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
442 void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
443
444 bool SaveImgFileName() const { return m_saveImgFileName;}
445 void SaveImgFileName(bool save) { m_saveImgFileName = save;}
446
448 bool GetAutoWrap() const
449 { return m_autoWrap > 0; }
450
451 // cppcheck-suppress functionStatic
453 static bool GetAutoWrapCode()
454 { return false; }
455
462 void SetAutoWrap(long autoWrap){m_autoWrap = autoWrap;}
463
465 bool GetAutoIndent() const
466 { return m_autoIndent; }
467
468 void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
469
471 bool IndentMaths() const {return m_indentMaths;}
472 void IndentMaths(bool indent){
473 if(m_indentMaths != indent)
474 RecalculateForce();
475 m_indentMaths = indent;}
476 AFontSize GetFontSize(TextStyle st) const { return m_styles[st].GetFontSize(); }
477
478 static const wxString &GetStyleName(TextStyle textStyle);
479
485 void ReadStyles(const wxString &file = {});
486
491 void WriteStyles(const wxString &file = {});
492 void WriteStyles(wxConfigBase *config);
493 void WriteSettings(const wxString &file = {});
494 void MakeStylesConsistent();
495 void Outdated(bool outdated)
496 { m_outdated = outdated; }
497
499 bool CheckKeepPercent() const
500 { return m_keepPercent; }
501
503 void SetKeepPercent(bool keepPercent)
504 {
505 if(m_keepPercent != keepPercent)
506 RecalculateForce();
507 m_keepPercent = keepPercent;
508 }
509
510 wxString GetTeXCMRI() const
511 { return m_fontCMRI; }
512
513 wxString GetTeXCMSY() const
514 { return m_fontCMSY; }
515
516 wxString GetTeXCMEX() const
517 { return m_fontCMEX; }
518
519 wxString GetTeXCMMI() const
520 { return m_fontCMMI; }
521
522 wxString GetTeXCMTI() const
523 { return m_fontCMTI; }
524
525 bool ShowCodeCells() const
526 { return m_showCodeCells; }
527
528 void ShowCodeCells(bool show);
529
536 void SetPrinting(bool printing);
537
544 bool GetPrinting() const
545 { return m_printing; }
546
548 wxColour GetColor(TextStyle style);
549
551 static wxColour InvertColour(wxColour col);
552
557 wxColor MakeColorDifferFromBackground(wxColor color);
558
559 bool UsePngCairo() const { return m_usepngCairo;}
560 void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
561
562 bool GetMatchParens() const { return m_matchParens; }
563 void SetMatchParens(bool matchParens) { m_matchParens = matchParens; }
564 bool ShowMatchingParens() const { return m_showMatchingParens; }
565 void ShowMatchingParens(bool show) { m_showMatchingParens = show; }
566
568 bool GetChangeAsterisk() const{ return m_changeAsterisk; }
569
571 void SetChangeAsterisk(bool changeAsterisk) {
572 if(m_changeAsterisk != changeAsterisk)
573 RecalculateForce();
574 m_changeAsterisk = changeAsterisk;
575 }
576
577 bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
578
579 void HidemultiplicationSign(bool show) {
580 if(m_hidemultiplicationsign != show)
581 RecalculateForce();
582 m_hidemultiplicationsign = show;
583 }
584
585 bool Latin2Greek() const
586 {return m_latin2greek;}
587
588 void Latin2Greek(bool latin2greek) {
589 if(m_latin2greek != latin2greek)
590 RecalculateForce();
591 m_latin2greek = latin2greek;
592 }
593
594 bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
595 void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
596
597 bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
598 void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
599
600 wxString SymbolPaneAdditionalChars() const
601 {return m_symbolPaneAdditionalChars;}
602 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
603
605 bool NotifyIfIdle() const
606 { return m_notifyIfIdle; }
607
608 void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
609
615 { return m_displayedDigits; }
616
617 void SetDisplayedDigits(long displayedDigits)
618 {
619 wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
620 if(m_displayedDigits != displayedDigits)
621 RecalculateForce();
622 m_displayedDigits = displayedDigits;
623 }
624
627 {
628 public:
629 FileToSave(const wxString &filename, const wxMemoryBuffer &data):
630 m_data(data),
631 m_filename(filename)
632 {
633 }
634 const wxString FileName() const{return m_filename;}
635 const wxMemoryBuffer Data() const{return m_data;}
636 private:
637 const wxMemoryBuffer m_data;
638 const wxString m_filename;
639 };
640
643 {
644 public:
645 TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
646 m_pos(pos),
647 m_text(text),
648 m_color(color)
649 {
650 }
651 const wxPoint Pos() const{return m_pos;}
652 const wxString Text() const{return m_text;}
653 const wxColor Color() const{return m_color;}
654 private:
655 const wxPoint m_pos;
656 const wxString m_text;
657 const wxColor m_color;
658 };
659
660 FileToSave PopFileToSave();
661 void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
662 { m_filesToSave.emplace_front(FileToSave(filename, data)); }
663
664 wxRect GetUpdateRegion() const {return m_updateRegion;}
665 const std::list<FileToSave> &GetFilesToSave() const {return m_filesToSave;}
666 void ClearFilesToSave () { m_filesToSave.clear();}
667 void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
668
671 bool InUpdateRegion(wxRect rect) const;
672
673 bool GetInsertAns() const
674 { return m_insertAns; }
675
676 void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
677
678 bool GetOpenHCaret() const
679 { return m_openHCaret; }
680
681 void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
682
683 bool RestartOnReEvaluation() const
684 { return m_restartOnReEvaluation; }
685
686 void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
687
689 wxSize GetCanvasSize() const
690 { return m_canvasSize; }
691
693 void SetCanvasSize(wxSize siz)
694 {
695 if(m_canvasSize.GetWidth() != siz.GetWidth())
696 RecalculateForce();
697 m_canvasSize = siz;
698 }
699
701 bool ShowBrackets() const
702 { return m_showBrackets; }
703
704 bool ShowBrackets(bool show)
705 {
706 if(m_showBrackets != show)
707 RecalculateForce();
708 return m_showBrackets = show;
709 }
710
712 bool PrintBrackets() const
713 { return m_printBrackets; }
714
715 showLabels GetLabelChoice() const
716 { return m_showLabelChoice; }
717
718 bool ShowInputLabels() const {return m_showInputLabels;}
719 void ShowInputLabels(bool show) {
720 if(m_showInputLabels != show)
721 RecalculateForce();
722 m_showInputLabels = show;
723 }
724
725 bool InvertBackground() const {return m_invertBackground;}
726 void InvertBackground(bool invert){ m_invertBackground = invert; }
727
728 long UndoLimit(){return std::max(m_undoLimit, static_cast<long>(0));}
729 void UndoLimit(long limit){ m_undoLimit = limit; }
730
731 long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
732 void RecentItems(long items){ m_recentItems = items; }
733
736 { return (m_showLabelChoice < labels_useronly); }
737
739 bool UseUserLabels() const
740 { return m_showLabelChoice > labels_automatic; }
741
743 bool ShowLabels() const
744 { return m_showLabelChoice < labels_none; }
745
747 void SetLabelChoice(showLabels choice) {
748 if(m_showLabelChoice != choice)
749 RecalculateForce();
750 m_showLabelChoice = choice;
751 }
752
753 bool PrintBrackets(bool print)
754 {
755 m_printBrackets = print;
756 return print;
757 }
758
760 bool AutodetectMaxima() const {return m_autodetectMaxima;}
762 void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
763
765 wxString MaximaParameters() const {return m_maximaParameters;}
767 void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
768
770 static wxString MaximaDefaultLocation();
771
773 wxString MaximaLocation() const;
774
776 wxString MaximaUserLocation() const {return m_maximaUserLocation;}
777
779 void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
780
782 bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
784 void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
785
787 bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
789 void InternalHelpBrowser(bool useInternalHelpBrowser)
790 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
791
793 bool SinglePageManual() const {return m_singlePageManual;}
795 void SinglePageManual(bool singlePageManual)
796 {m_singlePageManual = singlePageManual;}
797
799 wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
800
802 void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
803
810 static wxString FindProgram(const wxString &location);
811
814 { return m_fixReorderedIndices; }
815
816 void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
817
819 wxString MathJaXURL() const {
820 if(m_mathJaxURL_UseUser)
821 return m_mathJaxURL;
822 else
823 return MathJaXURL_Auto();}
824 wxString MathJaXURL_User() const { return m_mathJaxURL;}
825 bool MathJaXURL_UseUser() const { return m_mathJaxURL_UseUser;}
826 void MathJaXURL_UseUser(bool useUser){m_mathJaxURL_UseUser = useUser;}
827
828 bool EnterEvaluates() const {return m_enterEvaluates;}
829 void EnterEvaluates(bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
830 static wxString MathJaXURL_Auto() { return wxS("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
832 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
833
834 bool CopyBitmap() const {return m_copyBitmap;}
835 void CopyBitmap(bool copyBitmap){ m_copyBitmap = copyBitmap; }
836
837 bool CopyMathML() const {return m_copyMathML;}
838 void CopyMathML(bool copyMathML){ m_copyMathML = copyMathML;}
839 bool CopyMathMLHTML() const {return m_copyMathMLHTML;}
840 void CopyMathMLHTML(bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
841 bool HideMarkerForThisMessage(wxString message);
842 void HideMarkerForThisMessage(const wxString &message, bool hide)
843 {m_hideMarkerForThisMessage[message] = hide;}
844 bool CopyRTF() const {return m_copyRTF;}
845 void CopyRTF(bool copyRTF) { m_copyRTF = copyRTF; }
846 bool CopySVG() const {return m_copySVG;}
847 void CopySVG(bool copySVG) { m_copySVG = copySVG; }
848 bool CopyEMF() const {return m_copyEMF;}
849 void CopyEMF(bool copyEMF) { m_copyEMF = copyEMF; }
850 bool UseSVG() const {return m_useSVG;}
851 void UseSVG(bool useSVG) { m_useSVG = useSVG ;}
853 void ShowLength(long length) {
854 m_showLength = length;
855 }
857 long ShowLength() const {return m_showLength;}
859 std::size_t ShowLength_Bytes() const;
860
863 if(m_parenthesisDrawMode != mode)
864 RecalculateForce();
865 m_parenthesisDrawMode = mode;
866 }
867
868 void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
869
870 bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
871
872 void UseUnicodeMaths(bool useunicodemaths)
873 { m_useUnicodeMaths = useunicodemaths; }
874 bool UseUnicodeMaths() const {return m_useUnicodeMaths;}
875
876 StringBoolHash m_hideMarkerForThisMessage;
877
882 const Style *GetStyle(TextStyle textStyle) const { return &m_styles[textStyle]; }
890 Style *GetWritableStyle(TextStyle textStyle) { return &m_styles[textStyle]; }
891
893 wxWindow *GetWorkSheet() const {return m_workSheet;}
895 void SetWorkSheet(wxWindow *workSheet);
896
897 long DefaultPort() const {return m_defaultPort;}
898 void DefaultPort(long port){m_defaultPort = port;}
899 bool GetAbortOnError() const {return m_abortOnError;}
900 void SetAbortOnError(bool abortOnError) {m_abortOnError = abortOnError;}
901
902 long GetLanguage() const {return m_language;}
903 void SetLanguage(long language) {m_language = language;}
904
906 long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
907 void MaxGnuplotMegabytes(long megaBytes)
908 {m_maxGnuplotMegabytes = megaBytes;}
909
910 bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
911 void OfferKnownAnswers(bool offerKnownAnswers)
912 {m_offerKnownAnswers = offerKnownAnswers;}
913
914 wxString Documentclass() const {return m_documentclass;}
915 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
916 wxString DocumentclassOptions() const {return m_documentclassOptions;}
917 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
918
919
920 htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
921 void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
922 {m_htmlEquationFormat = HTMLequationFormat;}
923
924 AFontSize GetDefaultFontSize() const { return m_styles[TS_CODE_DEFAULT].GetFontSize(); }
925 AFontSize GetMathFontSize() const { return m_styles[TS_MATH].GetFontSize(); }
926
928 long GetAutosubscript_Num() const {return m_autoSubscript;}
929 void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
930 wxString GetAutosubscript_string() const;
932 wxColor DefaultBackgroundColor();
934 wxColor EditorBackgroundColor();
936 bool ClipToDrawRegion() const {return m_clipToDrawRegion;}
938 void ClipToDrawRegion(bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate = true;}
939 void SetVisibleRegion(wxRect visibleRegion){
940 if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
941 RecalculateForce();
942 m_visibleRegion = visibleRegion;
943 }
944 wxRect GetVisibleRegion() const {return m_visibleRegion;}
945 void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
946 wxPoint GetWorksheetPosition() const {return m_worksheetPosition;}
947 wxString MaximaShareDir() const {return m_maximaShareDir;}
948 void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
949 wxString MaximaDemoDir() const {return m_maximaDemoDir;}
950 void MaximaDemoDir(wxString dir){m_maximaDemoDir = std::move(dir);}
951 void InLispMode(bool lisp){m_inLispMode = lisp;}
952 bool InLispMode() const {return m_inLispMode;}
953 void BitmapScale(int factor){m_bitmapScale = factor;}
954 int BitmapScale() const {return m_bitmapScale;}
955 void DefaultPlotHeight(int px){m_defaultPlotHeight = px;}
956 int DefaultPlotHeight() const {return m_defaultPlotHeight;}
957 void DefaultPlotWidth(int px){m_defaultPlotWidth = px;}
958 int DefaultPlotWidth() const {return m_defaultPlotWidth;}
959 void DefaultFramerate(int fps){m_defaultFramerate = fps;}
960 int DefaultFramerate() const {return m_defaultFramerate;}
961 void TocDepth(int depth){m_tocDepth = depth;}
962 int TocDepth() const {return m_tocDepth;}
963 bool TeXExponentsAfterSubscript() const {return m_TeXExponentsAfterSubscript;}
964 void TeXExponentsAfterSubscript(bool ExponentsAfterSubscript)
965 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
966 bool UsePartialForDiff() const {return m_usePartialForDiff;}
967 void UsePartialForDiff(bool usePartialForDiff)
968 {m_usePartialForDiff = usePartialForDiff;}
970 void NotifyOfCellRedraw(const Cell *cell);
982 bool OfferInternalHelpBrowser() const;
983 bool WrapLatexMath() const {return m_wrapLatexMath;}
984 void WrapLatexMath(bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
985 bool AllowNetworkHelp() const {return m_allowNetworkHelp;}
986 void AllowNetworkHelp(bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
987 bool ShowAllDigits() const {return m_showAllDigits;}
988 void ShowAllDigits(bool shw){
989 if(m_showAllDigits != shw)
990 RecalculateForce();
991 m_showAllDigits = shw;
992 }
993 bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
994 void LineBreaksInLongNums(bool brk){
995 if(m_lineBreaksInLongNums != brk)
996 RecalculateForce();
997 m_lineBreaksInLongNums = brk;
998 }
999 int MaxClipbrdBitmapMegabytes() const {return m_maxClipbrd_BitmapMegabytes;}
1000 void MaxClipbrdBitmapMegabytes(int maxClipbrd_BitmapMegabytes)
1001 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
1002
1003 void MaximaUsesHtmlBrowser(bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1004 bool MaximaUsesHtmlBrowser() const {return m_maximaUsesHhtmlBrowser;}
1005 void MaximaUsesWxmaximaBrowser(bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1006 bool MaximaUsesWxmaximaBrowser() const {return m_maximaUsesWxmaximaBrowser && OfferInternalHelpBrowser();}
1007 void ExportContainsWXMX(bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1008 bool ExportContainsWXMX() const {return m_exportContainsWXMX;}
1009 void WizardTab(long tab){m_wizardTab = tab;}
1010 long WizardTab() const {return m_wizardTab;}
1011
1012 void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1013 bool Display2d_Unicode() const {return m_display2d_Unicode;}
1014
1015 #ifdef __WXMSW__
1016 bool UseWGnuplot() const {return m_useWgnuplot;}
1017 void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1018 #endif
1019 wxString TexPreamble() const {return m_texPreamble;}
1020 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1021
1022 void SetMaximaVersion(const wxString &version){m_maximaVersion = version;}
1023 wxString GetMaximaVersion() const {return m_maximaVersion;}
1024 void SetMaximaArch(const wxString &arch){m_maximaArch = arch;}
1025 wxString GetMaximaArch() const {return m_maximaArch;}
1026 void SetLispVersion(const wxString &version){m_lispVersion = version;}
1027 wxString GetLispVersion() const {return m_lispVersion;}
1028 void SetLispType(const wxString &type){m_lispType = type;}
1029 wxString GetLispType() const {return m_lispType;}
1030
1031 Style m_styles[NUMBEROFSTYLES];
1033 void InitStyles();
1035 bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1036 wxTextCtrl *LastActiveTextCtrl() const { return m_lastActiveTextCtrl; }
1037 void LastActiveTextCtrl(wxTextCtrl *last);
1038
1040 const std::vector<TextStyle> &GetCodeStylesList() const {return m_codeStyles;}
1042 const std::vector<TextStyle> &GetMathStylesList() const {return m_2dMathStyles;}
1044 const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_colorOnlyStyles;}
1045 bool StyleAffectsCode(TextStyle style) const;
1046 bool StyleAffectsMathOut(TextStyle style) const;
1047 bool StyleAffectsColorOnly(TextStyle style) const;
1049 bool UpdateNeeded() const;
1051 static void SetDebugmode(){m_debugMode = true;}
1053 static bool GetDebugmode(){return m_debugMode;}
1054 maximaHelpFormat MaximaHelpFormat() const;
1055 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1056
1057private:
1058 wxString m_maximaArch;
1059 wxString m_lispVersion;
1060 wxString m_lispType;
1061 wxString m_maximaVersion;
1063 InitOpt m_initOpts;
1069 long m_configId;
1070public:
1072 std::random_device m_rd;
1074 std::default_random_engine m_eng;
1082 std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
1083 void RecalculateForce() { m_cellCfgCnt++; }
1084 static bool UseThreads(){return m_use_threads;}
1085 static void UseThreads(bool use){m_use_threads = use;}
1086 static void SetMaximaLang(const wxString &LANG){m_maxima_LANG = LANG;}
1087 static wxString GetMaximaLang(){return m_maxima_LANG;}
1088private:
1090 static wxString m_maxima_LANG;
1092 std::vector<TextStyle> m_codeStyles;
1094 std::vector<TextStyle> m_2dMathStyles;
1096 std::vector<TextStyle> m_colorOnlyStyles;
1097 std::list<FileToSave> m_filesToSave;
1098 RenderablecharsHash m_renderableChars;
1099 RenderablecharsHash m_nonRenderableChars;
1101 static bool FontDisplaysChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1103 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar, const wxFont &font = *wxNORMAL_FONT);
1104 mathDisplayMode m_displayMode = display_2d;
1105 using CellRedrawTrace = std::vector<const Cell*>;
1106 static bool m_debugMode;
1107 bool m_showInputLabels;
1108 long m_wizardTab;
1109 bool m_display2d_Unicode;
1110 bool m_usePartialForDiff;
1111 bool m_maximaUsesHhtmlBrowser;
1112 bool m_maximaUsesWxmaximaBrowser;
1114 bool m_autoSaveAsTempFile;
1116 long m_language;
1118 bool m_autodetectMaxima;
1120 bool m_autodetectHelpBrowser;
1122 bool m_useInternalHelpBrowser;
1124 bool m_singlePageManual;
1126 wxRect m_updateRegion;
1128 bool m_incrementalSearch;
1130 long m_autoSubscript;
1132 wxWindow *m_workSheet = NULL;
1134 std::unique_ptr<wxClientDC> m_worksheetDC;
1147// bool CharsExistInFont(const wxFont &font, const wxString& chars);
1149 bool m_wrapLatexMath;
1150 bool m_allowNetworkHelp;
1151 bool m_exportContainsWXMX;
1152 wxString m_texPreamble;
1153
1154 drawMode m_parenthesisDrawMode;
1155 wxString m_workingdir;
1156 bool m_TeXExponentsAfterSubscript;
1157 wxString m_helpBrowserUserLocation;
1158 wxString m_maximaUserLocation;
1160 bool m_hideBrackets;
1162 double m_printScale;
1163 double m_printMargin_Top;
1164 double m_printMargin_Bot;
1165 double m_printMargin_Left;
1166 double m_printMargin_Right;
1168 wxSize m_canvasSize;
1170 bool m_showBrackets;
1172 bool m_printBrackets;
1178 bool m_changeAsterisk;
1180 bool m_notifyIfIdle;
1182 long m_displayedDigits;
1184 long m_autoWrap;
1186 bool m_autoIndent;
1188 bool m_showAllDigits;
1190 bool m_lineBreaksInLongNums;
1192 bool m_matchParens;
1194 bool m_insertAns;
1196 bool m_openHCaret;
1198 long m_labelWidth;
1199 long m_indent;
1200 bool m_latin2greek;
1201 double m_zoomFactor;
1202 wxDC *m_dc;
1203 wxString m_maximaShareDir;
1204 wxString m_maximaDemoDir;
1205 bool m_forceUpdate;
1206 bool m_clipToDrawRegion = true;
1207 bool m_outdated;
1208 wxString m_maximaParameters;
1209 bool m_keepPercent;
1210 bool m_restartOnReEvaluation;
1211 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1212 bool m_printing;
1213 long m_lineWidth_em;
1214 showLabels m_showLabelChoice;
1215 bool m_fixReorderedIndices;
1216 wxString m_mathJaxURL;
1217 bool m_mathJaxURL_UseUser;
1218 bool m_showCodeCells;
1219 bool m_copyBitmap;
1220 bool m_copyMathML;
1221 bool m_copyMathMLHTML;
1222 long m_showLength;
1224 bool m_inLispMode;
1225 bool m_usepngCairo;
1226 bool m_enterEvaluates;
1227 bool m_useSVG;
1228 bool m_fixedFontTC;
1229 bool m_copyRTF;
1230 bool m_copySVG;
1231 bool m_copyEMF;
1232 bool m_TOCshowsSectionNumbers;
1233 bool m_useUnicodeMaths;
1234 bool m_indentMaths;
1235 bool m_abortOnError;
1236 bool m_showMatchingParens;
1237 bool m_hidemultiplicationsign;
1238 bool m_offerKnownAnswers;
1239 long m_defaultPort;
1240 long m_maxGnuplotMegabytes;
1241 long m_defaultPlotHeight;
1242 long m_defaultPlotWidth;
1243 bool m_saveUntitled;
1244 bool m_cursorJump;
1245 bool m_numpadEnterEvaluates;
1246 bool m_saveImgFileName;
1254 std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1255 wxString m_documentclass;
1256 wxString m_documentclassOptions;
1257 htmlExportFormat m_htmlEquationFormat;
1259 wxRect m_visibleRegion;
1261 wxPoint m_worksheetPosition;
1262
1263 wxColour m_defaultBackgroundColor;
1265 wxBrush m_BackgroundBrush;
1266 wxBrush m_tooltipBrush;
1267 bool m_greekSidebar_ShowLatinLookalikes;
1268 #ifdef __WXMSW__
1269 bool m_useWgnuplot = false;
1270 #endif
1271 bool m_greekSidebar_Show_mu;
1272 wxString m_symbolPaneAdditionalChars;
1273 bool m_invertBackground;
1274 long m_undoLimit;
1275 long m_recentItems;
1276 int m_bitmapScale;
1277 int m_defaultFramerate;
1278 int m_tocDepth;
1279 int m_maxClipbrd_BitmapMegabytes;
1280 int m_autoSaveMinutes;
1281 int m_maxLayoutTime;
1282 wxString m_wxMathML_Filename;
1283 maximaHelpFormat m_maximaHelpFormat;
1284 wxTextCtrl *m_lastActiveTextCtrl = NULL;
1285 std::atomic<std::int_fast32_t> m_cellCfgCnt{0};
1286 static bool m_use_threads;
1287};
1288
1291{
1292public:
1293 explicit Printing(Configuration *configuration)
1294 {
1295 m_configuration = configuration;
1296 m_configuration->SetPrinting(true);
1297 }
1298 virtual ~Printing()
1299 {
1300 m_configuration->SetPrinting(false);
1301 }
1302private:
1303 Configuration * m_configuration;
1304};
1305
1308{
1309public:
1310 explicit NoClipToDrawRegion(Configuration *configuration)
1311 {
1312 m_configuration = configuration;
1313 m_configuration->ClipToDrawRegion(false);
1314 }
1315 virtual ~NoClipToDrawRegion()
1316 {
1317 m_configuration->ClipToDrawRegion(true);
1318 }
1319private:
1320 Configuration * m_configuration;
1321};
1322
1323#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:627
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:643
The configuration storage for the current worksheet.
Definition: Configuration.h:85
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1406
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:278
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:799
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:998
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:928
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:735
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:784
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:832
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:219
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1053
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:568
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:260
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:462
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:214
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:448
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1015
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1024
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:577
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1060
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:399
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:210
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:183
static const wxString & GetEscCode(const wxString &key)
Retrieve a symbol for the escape codes that can be typed after hitting the Escape key in the workshee...
Definition: Configuration.cpp:539
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:234
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:605
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:547
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:893
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1050
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1196
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:136
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:747
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:503
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:793
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:1042
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:991
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:776
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:890
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:306
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1268
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:143
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:321
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1082
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:743
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:194
std::random_device m_rd
Our random device.
Definition: Configuration.h:1072
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:765
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:689
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:789
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:274
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:415
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:795
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:471
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1189
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:571
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:177
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:465
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:310
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:168
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:241
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:152
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:355
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:145
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:453
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:906
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:364
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:802
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:148
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:499
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1040
static const wxString CharsNeedingQuotes()
Returns a list of chars we need to escape in maxima.
Definition: Configuration.h:291
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:819
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:762
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:571
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1074
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:245
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:198
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:482
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1051
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:206
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:760
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:936
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1092
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:701
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:813
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:544
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:181
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:376
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1065
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:179
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:550
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:228
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:779
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:938
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:339
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:191
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:427
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:238
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:406
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1394
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:620
InitOpt
Definition: Configuration.h:118
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:120
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:787
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:862
drawMode
Definition: Configuration.h:112
@ ascii
Use ascii characters only.
Definition: Configuration.h:113
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:114
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:693
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:767
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1005
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:857
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:236
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1200
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:94
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:138
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:739
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:614
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:882
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:782
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:853
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:313
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1044
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:712
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1308
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1291
Text Style Definition.
Definition: TextStyle.h:63
AFontSize GetFontSize() const
The size of this style's font, asserted to be valid.
Definition: TextStyle.cpp:108
Definition: Configuration.h:391