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"
34#include "MaximaSessionInfo.h"
35#include "RenderContext.h"
36#include "Styles.h"
37#include <cstdint>
38#include <functional>
39#include <memory>
40#include <mutex>
41#include <optional>
42#include <unordered_map>
43#include <random>
44#include <list>
45#include <variant>
46#include <vector>
47#include <algorithm>
48#include <atomic>
49#include <chrono>
50#include <wx/wupdlock.h>
51#include <list>
52
53#define MC_LINE_SKIP Scale_Px(2)
54#define MC_TEXT_PADDING Scale_Px(1)
55
56#define PAREN_OPEN_TOP_UNICODE "\u239b"
57#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
58#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
59#define PAREN_CLOSE_TOP_UNICODE "\u239e"
60#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
61#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
62#define SUM_SIGN "\u2211"
63#define PROD_SIGN "\u220F"
65#define SUM_DEC 2
66
68#define MC_HCARET_WIDTH 25
69
70#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
71static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
72static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
73
74// The minimal and maximal label width
75#define LABELWIDTH_MIN 3
76#define LABELWIDTH_MAX 10
77class Cell;
80class GroupCell;
82template<class T> class wxScrolled;
84
100{
101public:
103 std::atomic<long> manualAnchorsFromBuiltin{0};
104 std::atomic<long> manualAnchorsFromCache{0};
105 std::atomic<long> manualAnchorsCompiled{0};
106 std::atomic<long> maximaProcessesSpawned{0};
107 std::atomic<long> fontCacheHits{0};
108 std::atomic<long> fontCacheMisses{0};
109 std::atomic<long> recalculationNeeded_FontInvalid{0};
110 std::atomic<long> recalculationNeeded_SizeInvalid{0};
111 std::atomic<long> recalculationNeeded_FontMismatch{0};
112 std::atomic<long> recalculationNeeded_ConfigChanged{0};
113 std::atomic<long> recalculationNeeded_CellsAppended{0};
114 std::atomic<long> recalculationNeeded_EditorDirty{0};
115 std::atomic<long> cellsConvertedToLinear{0};
116 std::atomic<long> cellsConvertedTo2D{0};
125 std::atomic<long> cellsDrawnAtWrongFontSize{0};
127 std::atomic<long> worksheetRepaints{0};
135 std::atomic<long> worksheetFullRepaints{0};
136 void Report() const;
137 };
138 static PerformanceStats g_stats;
139
140 enum maximaHelpFormat{
141 maxima = 0,
142 frontend = 1,
143 browser = 2
144 };
147 {
152 bitmap = 1,
156 svg = 3,
160 html_export_invalidChoice
161 };
162
163 enum showLabels : int8_t
164 {
165 labels_automatic = 0,
166 labels_prefer_user = 1,
167 labels_useronly = 2,
168 labels_none = 3,
169 labels_invalidSelection
170 };
171
173 {
175 handdrawn
176 };
177
179 {
180 none,
181 temporary
182 };
183
184 enum mathDisplayMode
185 {
186 display_2d,
187 display_2dASCII,
188 display_2dUNICODE,
189 display_1dASCII
190 };
191
192 using StringBoolHash = std::unordered_map<wxString, bool, wxStringHash>;
194 bool IsOperator(wxString name) const {return m_maximaSession.IsOperator(name);}
196 void AddMaximaOperator(const wxString &name){m_maximaSession.AddOperator(name);}
197 const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
199 void ClearMaximaEnvVars(){m_maximaEnvVars.clear();}
201 void SetMaximaEnvVar(const wxString &name, const wxString &value){m_maximaEnvVars[name] = value;}
202
204 mathDisplayMode DisplayMode() const {return m_displayMode;}
206 void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
207
209 void SetWorkingDirectory(wxString dir)
210 { m_maximaSession.SetWorkingDirectory(std::move(dir)); }
211
213 wxString GetWorkingDirectory() const
214 { return m_maximaSession.GetWorkingDirectory(); }
215
217 void ReadConfig();
218
223 explicit Configuration(wxDC *dc = {}, InitOpt options = none);
225
235 void MakeTemporary() { m_initOpts = temporary; }
236
238 void ResetAllToDefaults();
239
241 void SetRecalcContext(wxDC &dc)
242 {
243 m_renderContext.SetRecalcDC(&dc);
244 }
245 void UnsetContext() {m_renderContext.SetRecalcDC(nullptr);}
246
248 void SetBackgroundBrush(const wxBrush &brush);
250 bool FixedFontInTextControls() const {return m_fixedFontTC;}
252 void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
254 wxBrush GetBackgroundBrush() const {return m_renderContext.GetBackgroundBrush();}
256 wxBrush GetTooltipBrush() const {return m_tooltipBrush;}
257
258 virtual ~Configuration();
259
265
266 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
267 using EscCodeIterator = EscCodeContainer::const_iterator;
268
270 static const wxString &GetEscCode(const wxString &key);
272 static EscCodeIterator EscCodesBegin();
274 static EscCodeIterator EscCodesEnd();
275
277 static double GetMinZoomFactor()
278 { return 0.1; }
279
281 static double GetMaxZoomFactor()
282 { return 32.0; }
283
290 double GetInterEquationSkip() const
291 {
293 return 0;
294 else
295 return GetZoomFactor() * m_styleStore[TS_MATH].GetFontSize() / 2;
296 }
297
299 wxCoord GetCellBracketWidth() const
300 {
301 return static_cast<wxCoord>(GetZoomFactor() * 16);
302 }
303
305 bool HideBrackets() const
306 { return m_hideBrackets; }
307
309 void HideBrackets(bool hide){m_hideBrackets = hide;}
310
318 bool OverlayScrollbars() const
319 { return m_overlayScrollbars; }
320
322 void OverlayScrollbars(bool overlay){m_overlayScrollbars = overlay;}
323
325 double PrintScale() const
326 { return m_printScale; }
327
329 void PrintScale(double scale){m_printScale = scale;}
330
331 void PrintMargin_Top(double margin){m_printMargin_Top = margin;}
332 void PrintMargin_Bot(double margin){m_printMargin_Bot = margin;}
333 void PrintMargin_Left(double margin){m_printMargin_Left = margin;}
334 void PrintMargin_Right(double margin){m_printMargin_Right = margin;}
335 double PrintMargin_Top() const {return m_printMargin_Top;}
336 double PrintMargin_Bot() const {return m_printMargin_Bot;}
337 double PrintMargin_Left() const {return m_printMargin_Left;}
338 double PrintMargin_Right() const {return m_printMargin_Right;}
339
341 void SetZoomFactor(double newzoom);
342
344 void SetZoomFactor_temporarily(double newzoom){
345 if(m_zoomFactor != newzoom)
347 m_zoomFactor = newzoom;
348 }
349
354 wxCoord Scale_Px(double px) const;
355 AFontSize Scale_Px(AFontSize size) const;
356
358 double GetZoomFactor() const
359 { return m_zoomFactor; }
360
362 wxDC *GetRecalcDC() const
363 { return m_renderContext.GetRecalcDC(); }
364
365 void SetRecalcDC(wxDC *dc)
366 { m_renderContext.SetRecalcDC(dc); }
367
368 wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
369
370 // cppcheck-suppress functionStatic
371 // cppcheck-suppress functionConst
372 wxString GetSymbolFontName() const;
373
375 static const wxString CharsNeedingQuotes()
376 {
377 return wxString(wxS("°,\\'\"()[]-{}^+*/&§?:;=#<>$"));
378 }
379
380 wxFontWeight IsBold(long st) const;
381
382 wxFontStyle IsItalic(long st) const;
383
384 bool IsUnderlined(long st) const {return m_styleStore[st].IsUnderlined();}
385
390 wxCoord GetLabelWidth() const
391 { return m_labelWidth * 14; }
392
394 long LabelWidth() const
395 { return m_labelWidth; }
397 void LabelWidth(long labelWidth)
398 {
399 if(m_labelWidth != labelWidth)
401 m_labelWidth = labelWidth;
402 }
403
405 wxCoord GetIndent() const
406 {
407 if (m_indent < 0)
408 return 3 * GetCellBracketWidth() / 2;
409 else
410 return m_indent;
411 }
412
418 wxSize GetPPI() const;
419 int AutosaveMinutes() const {return m_autoSaveMinutes;}
420 void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
421
423 long GetCursorWidth() const
424 {
425 long ppi;
426
427 if(!GetPrinting())
428 ppi = GetPPI().x;
429 else
430 ppi = 96;
431
432 if (ppi / 45 < 1)
433 return 1;
434 else
435 return ppi / 45;
436 }
437
447 int GetWorksheetTopOffset() const { return m_worksheetTopOffset; }
453 void SetWorksheetTopOffset(int offset) { m_worksheetTopOffset = offset; }
454
456 long GetBaseIndent() const
457 {
458 if (GetCursorWidth() < 12)
459 return 12;
460 else
461 return 4 + GetCursorWidth();
462 }
463
465 long GetGroupSkip() const
466 {
467 if (GetCursorWidth() < 10)
468 return 20;
469 else
470 return 10 + GetCursorWidth();
471 }
472
477 void SetIndent(long indent)
478 {
479 if(m_indent != indent)
481 m_indent = indent;
482 }
483
484 bool IncrementalSearch() const {return m_incrementalSearch;}
485
486
487 void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
488
489 int MaxLayoutTime() const { return m_maxLayoutTime; }
490 void MaxLayoutTime(int time) { m_maxLayoutTime = time; }
491
492 enum class LayoutStrategy {
493 layout2DWheneverPossible = 0,
494 layout2DIfFits = 1,
495 layoutPrefer1D = 2
496 };
497 LayoutStrategy GetLayoutStrategy() const { return m_layoutStrategy; }
498 void SetLayoutStrategy(LayoutStrategy s) { m_layoutStrategy = s; }
499
506 enum class OversizedMatrices {
508 showInFull = 0,
510 elide = 1,
517 scroll = 2
518 };
519 OversizedMatrices GetOversizedMatrices() const { return m_oversizedMatrices; }
529 void SetOversizedMatrices(OversizedMatrices mode, bool perMatrixOverridable = true) {
530 if ((mode != m_oversizedMatrices) ||
531 (perMatrixOverridable != m_oversizedMatricesOverridable))
533 m_oversizedMatrices = mode;
534 m_oversizedMatricesOverridable = perMatrixOverridable;
535 }
546 OversizedMatrices OversizedMatricesFor(std::optional<OversizedMatrices> requested) const {
547 if (requested && m_oversizedMatricesOverridable)
548 return *requested;
549 return m_oversizedMatrices;
550 }
551
558 MatrixScrollHost *GetMatrixScrollHost() const { return m_matrixScrollHost; }
566 void SetMatrixScrollHost(MatrixScrollHost *host) { m_matrixScrollHost = host; }
567
568 void SetLayoutDeadline(int seconds) {
569 m_renderContext.SetLayoutDeadline(seconds);
570 }
571 void ClearLayoutCancelled() {
572 m_renderContext.ClearLayoutCancelled();
573 }
574 bool IsLayoutCancelled() const {
575 return m_renderContext.IsLayoutCancelled();
576 }
577
580 {
582 }
583
585 double GetDefaultLineWidth() const
586 {
587 if (GetZoomFactor() < 1.0)
588 return 1.0;
589 else
590 return GetZoomFactor();
591 }
592
594 long LineWidth_em() const
595 {
596 if(!GetPrinting())
597 return m_lineWidth_em;
598 else
599 return 10000;
600 }
601
602 bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
603 void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
604
606 void LineWidth_em(long width)
607 { m_lineWidth_em = width; }
608
610 // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
611 // But text blocks that are 1 meter wide and 2 cm high feel - weird.
612 long GetLineWidth() const;
613
617 long GetAsciiArtColumns() const;
618
619 bool SaveUntitled() const { return m_saveUntitled;}
620 void SaveUntitled(bool save) {m_saveUntitled = save;}
621
622 bool CursorJump() const { return m_cursorJump;}
623 void CursorJump(bool save){m_cursorJump = save;}
624
625 bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
626 void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
627
628 bool SaveImgFileName() const { return m_saveImgFileName;}
629 void SaveImgFileName(bool save) { m_saveImgFileName = save;}
630
632 bool GetAutoWrap() const
633 { return m_autoWrap > 0; }
634
636 bool GetAutoWrapCode() const
637 { return m_autoWrap > 1; }
638
650 void SetAutoWrap(long autoWrap){
651 m_autoWrap = autoWrap;
652 if (m_autoWrap < 0)
653 m_autoWrap = 0;
654 if (m_autoWrap > 2)
655 m_autoWrap = 1;
656 }
657
659 bool GetAutoIndent() const
660 { return m_autoIndent; }
661
662 void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
663
665 bool IndentMaths() const {return m_indentMaths;}
666 void IndentMaths(bool indent){
667 if(m_indentMaths != indent)
669 m_indentMaths = indent;}
670 AFontSize GetFontSize(TextStyle st) const { return m_styleStore[st].GetFontSize(); }
671
672 static const wxString &GetStyleName(TextStyle textStyle);
673
679 void ReadStyles(const wxString &file = {});
680
685 void WriteStyles(const wxString &file = {});
686 void WriteStyles(wxConfigBase *config);
687 void WriteSettings(const wxString &file = {});
695 static const std::vector<std::pair<TextStyle, wxString>> &StyleConfigKeys();
696
704 const wxChar *key;
706 std::variant<bool Configuration::*, int Configuration::*,
707 long Configuration::*, double Configuration::*,
708 wxString Configuration::*>
710 };
721 static const std::vector<ScalarSetting> &ScalarConfigSettings();
722 void MakeStylesConsistent();
723 void Outdated(bool outdated)
724 { m_outdated = outdated; }
725
727 bool CheckKeepPercent() const
728 { return m_keepPercent; }
729
731 void SetKeepPercent(bool keepPercent)
732 {
733 if(m_keepPercent != keepPercent)
735 m_keepPercent = keepPercent;
736 }
737
738 wxString GetTeXCMRI() const
739 { return m_fontCMRI; }
740
741 wxString GetTeXCMSY() const
742 { return m_fontCMSY; }
743
744 wxString GetTeXCMEX() const
745 { return m_fontCMEX; }
746
747 wxString GetTeXCMMI() const
748 { return m_fontCMMI; }
749
750 wxString GetTeXCMTI() const
751 { return m_fontCMTI; }
752
753 bool ShowCodeCells() const
754 { return m_showCodeCells; }
755
756 void ShowCodeCells(bool show);
757
764 void SetPrinting(bool printing);
765
772 bool GetPrinting() const
773 { return m_renderContext.Printing(); }
774
776 wxColour GetColor(TextStyle style);
777
778
779 bool UsePngCairo() const { return m_usepngCairo;}
780 void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
781
782 bool GetMatchParens() const { return m_matchParens; }
783 void SetMatchParens(bool matchParens) { m_matchParens = matchParens; }
784 bool ShowMatchingParens() const { return m_showMatchingParens; }
785 void ShowMatchingParens(bool show) { m_showMatchingParens = show; }
786
788 bool GetChangeAsterisk() const{ return m_changeAsterisk; }
789
791 void SetChangeAsterisk(bool changeAsterisk) {
792 if(m_changeAsterisk != changeAsterisk)
794 m_changeAsterisk = changeAsterisk;
795 }
796
797 bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
798
799 void HidemultiplicationSign(bool show) {
800 if(m_hidemultiplicationsign != show)
802 m_hidemultiplicationsign = show;
803 }
804
805 bool Latin2Greek() const
806 {return m_latin2greek;}
807
808 void Latin2Greek(bool latin2greek) {
809 if(m_latin2greek != latin2greek)
811 m_latin2greek = latin2greek;
812 }
813
814 bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
815 void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
816
817 bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
818 void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
819
820 wxString SymbolPaneAdditionalChars() const
821 {return m_symbolPaneAdditionalChars;}
822 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
823
825 bool NotifyIfIdle() const
826 { return m_notifyIfIdle; }
827
828 void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
829
832 { return m_findDialogDockable; }
833
834 void FindDialogDockable(bool dockable) {m_findDialogDockable = dockable;}
835
842 bool McpServerEnabled() const { return m_mcpServerEnabled; }
843 void McpServerEnabled(bool enabled) { m_mcpServerEnabled = enabled; }
844
846 int McpServerPort() const { return m_mcpServerPort; }
847 void McpServerPort(int port) { m_mcpServerPort = port; }
848
853 int AiChatProvider() const { return m_aiChatProvider; }
854 void AiChatProvider(int provider) { m_aiChatProvider = provider; }
855
865 wxString AiApiKeyAnthropic() const;
866 void AiApiKeyAnthropic(const wxString &key);
867 wxString AiApiKeyOpenAI() const;
868 void AiApiKeyOpenAI(const wxString &key);
869 wxString AiApiKeyGoogle() const;
870 void AiApiKeyGoogle(const wxString &key);
871 wxString AiApiKeyQwen() const;
872 void AiApiKeyQwen(const wxString &key);
876 wxString AiApiKeyGitHubModels() const;
877 void AiApiKeyGitHubModels(const wxString &key);
878 wxString AiApiKeyDeepSeek() const;
879 void AiApiKeyDeepSeek(const wxString &key);
880 wxString AiApiKeyOpenRouter() const;
881 void AiApiKeyOpenRouter(const wxString &key);
882
886 wxString AiModelAnthropic() const { return m_aiModelAnthropic; }
887 void AiModelAnthropic(const wxString &model) { m_aiModelAnthropic = model; }
888 wxString AiModelOpenAI() const { return m_aiModelOpenAI; }
889 void AiModelOpenAI(const wxString &model) { m_aiModelOpenAI = model; }
890 wxString AiModelGoogle() const { return m_aiModelGoogle; }
891 void AiModelGoogle(const wxString &model) { m_aiModelGoogle = model; }
892 wxString AiModelQwen() const { return m_aiModelQwen; }
893 void AiModelQwen(const wxString &model) { m_aiModelQwen = model; }
894 wxString AiModelGitHubModels() const { return m_aiModelGitHubModels; }
895 void AiModelGitHubModels(const wxString &model) { m_aiModelGitHubModels = model; }
896 wxString AiModelDeepSeek() const { return m_aiModelDeepSeek; }
897 void AiModelDeepSeek(const wxString &model) { m_aiModelDeepSeek = model; }
898 wxString AiModelOpenRouter() const { return m_aiModelOpenRouter; }
899 void AiModelOpenRouter(const wxString &model) { m_aiModelOpenRouter = model; }
900
906 wxString AiCustomProvidersJson() const { return m_aiCustomProvidersJson; }
907 void AiCustomProvidersJson(const wxString &json) { m_aiCustomProvidersJson = json; }
908
912 wxString AiActiveCustomProviderId() const { return m_aiActiveCustomProviderId; }
913 void AiActiveCustomProviderId(const wxString &id) { m_aiActiveCustomProviderId = id; }
914
920 { return m_displayedDigits; }
921
922 void SetDisplayedDigits(long displayedDigits)
923 {
924 wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
925 if(m_displayedDigits != displayedDigits)
927 m_displayedDigits = displayedDigits;
928 }
929
932 {
933 public:
934 FileToSave(const wxString &filename, const wxMemoryBuffer &data):
935 m_data(data),
936 m_filename(filename)
937 {
938 }
939 const wxString FileName() const{return m_filename;}
940 const wxMemoryBuffer Data() const{return m_data;}
941 private:
942 const wxMemoryBuffer m_data;
943 const wxString m_filename;
944 };
945
948 {
949 public:
950 TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
951 m_pos(pos),
952 m_text(text),
953 m_color(color)
954 {
955 }
956 const wxPoint Pos() const{return m_pos;}
957 const wxString Text() const{return m_text;}
958 const wxColor Color() const{return m_color;}
959 private:
960 const wxPoint m_pos;
961 const wxString m_text;
962 const wxColor m_color;
963 };
964
965 void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
966 { m_filesToSave.emplace_front(FileToSave(filename, data)); }
967
968 wxRect GetUpdateRegion() const {return m_renderContext.GetUpdateRegion();}
969 const std::list<FileToSave> &GetFilesToSave() const {return m_filesToSave;}
970 void ClearFilesToSave () { m_filesToSave.clear();}
971 void SetUpdateRegion(wxRect rect){m_renderContext.SetUpdateRegion(rect);}
972
975 bool InUpdateRegion(wxRect rect) const;
976
977 bool GetInsertAns() const
978 { return m_insertAns; }
979
980 void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
981
982 bool GetOpenHCaret() const
983 { return m_openHCaret; }
984
985 void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
986
987 bool RestartOnReEvaluation() const
988 { return m_restartOnReEvaluation; }
989
990 void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
991
993 wxSize GetCanvasSize() const
994 { return m_renderContext.GetCanvasSize(); }
995
997 void SetCanvasSize(wxSize siz)
998 {
999 if(GetCanvasSize().GetWidth() != siz.GetWidth() ||
1000 GetCanvasSize().GetHeight() != siz.GetHeight())
1002 m_renderContext.SetCanvasSize(siz);
1003 }
1004
1022 { return m_rightToLeftDocument; }
1023
1024 bool RightToLeftDocument(bool rightToLeft)
1025 {
1026 if (m_rightToLeftDocument != rightToLeft)
1028 return m_rightToLeftDocument = rightToLeft;
1029 }
1030
1032 bool ShowBrackets() const
1033 { return m_showBrackets; }
1034
1035 bool ShowBrackets(bool show)
1036 {
1037 if(m_showBrackets != show)
1039 return m_showBrackets = show;
1040 }
1041
1043 bool PrintBrackets() const
1044 { return m_printBrackets; }
1045
1046 showLabels GetLabelChoice() const
1047 { return m_showLabelChoice; }
1048
1049 bool ShowInputLabels() const {return m_showInputLabels;}
1050 void ShowInputLabels(bool show) {
1051 if(m_showInputLabels != show)
1053 m_showInputLabels = show;
1054 }
1055
1057 enum class Appearance { light, dark, followSystem };
1058 Appearance GetAppearance() const { return m_appearance; }
1061 m_appearance = a;
1062 m_styleStore.SetUseDark(UseDarkMode());
1064 }
1066 void UpdateBackgroundBrush();
1068 bool UseDarkMode() const {
1069 if (m_appearance == Appearance::dark) return true;
1070 if (m_appearance == Appearance::light) return false;
1071 return SystemIsDark();
1072 }
1074 static bool SystemIsDark();
1075
1076 long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
1077 void RecentItems(long items){ m_recentItems = items; }
1078
1081 { return (m_showLabelChoice < labels_useronly); }
1082
1084 bool UseUserLabels() const
1085 { return m_showLabelChoice > labels_automatic; }
1086
1088 bool ShowLabels() const
1089 { return m_showLabelChoice < labels_none; }
1090
1092 void SetLabelChoice(showLabels choice) {
1093 if(m_showLabelChoice != choice)
1095 m_showLabelChoice = choice;
1096 }
1097
1098 bool PrintBrackets(bool print)
1099 {
1100 m_printBrackets = print;
1101 return print;
1102 }
1103
1105 bool AutodetectMaxima() const {return m_autodetectMaxima;}
1107 void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
1108
1110 wxString MaximaParameters() const {return m_maximaParameters;}
1112 void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
1113
1115 static wxString MaximaDefaultLocation();
1116
1118 wxString MaximaLocation() const;
1119
1121 wxString MaximaUserLocation() const {return m_maximaUserLocation;}
1122
1124 void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
1125
1127 bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
1129 void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
1130
1132 bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
1134 void InternalHelpBrowser(bool useInternalHelpBrowser)
1135 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
1136
1138 bool SinglePageManual() const {return m_singlePageManual;}
1140 void SinglePageManual(bool singlePageManual)
1141 {m_singlePageManual = singlePageManual;}
1142
1144 wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
1145
1147 void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
1148
1155 static wxString FindProgram(const wxString &location);
1156
1159 { return m_fixReorderedIndices; }
1160
1161 void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
1162
1164 wxString MathJaXURL() const {
1165 if(m_mathJaxURL_UseUser)
1166 return m_mathJaxURL;
1167 else
1168 return MathJaXURL_Auto();}
1169 wxString MathJaXURL_User() const { return m_mathJaxURL;}
1170 bool MathJaXURL_UseUser() const { return m_mathJaxURL_UseUser;}
1171 void MathJaXURL_UseUser(bool useUser){m_mathJaxURL_UseUser = useUser;}
1172
1173 bool EnterEvaluates() const {return m_enterEvaluates;}
1174 void EnterEvaluates(bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
1175 static wxString MathJaXURL_Auto() { return wxS("https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js");}
1177 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
1178
1179 bool CopyBitmap() const {return m_copyBitmap;}
1180 void CopyBitmap(bool copyBitmap){ m_copyBitmap = copyBitmap; }
1181
1182 bool CopyMathML() const {return m_copyMathML;}
1183 void CopyMathML(bool copyMathML){ m_copyMathML = copyMathML;}
1184 bool CopyMathMLHTML() const {return m_copyMathMLHTML;}
1185 void CopyMathMLHTML(bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
1186 bool HideMarkerForThisMessage(wxString message);
1187 void HideMarkerForThisMessage(const wxString &message, bool hide)
1188 {m_hideMarkerForThisMessage[message] = hide;}
1189 bool CopyRTF() const {return m_copyRTF;}
1190 void CopyRTF(bool copyRTF) { m_copyRTF = copyRTF; }
1191 bool CopySVG() const {return m_copySVG;}
1192 void CopySVG(bool copySVG) { m_copySVG = copySVG; }
1193 bool CopyEMF() const {return m_copyEMF;}
1194 void CopyEMF(bool copyEMF) { m_copyEMF = copyEMF; }
1195 bool UseSVG() const {return m_useSVG;}
1196 void UseSVG(bool useSVG) { m_useSVG = useSVG ;}
1198 void ShowLength(long length) {
1199 m_showLength = length;
1200 }
1202 long ShowLength() const {return m_showLength;}
1204 std::size_t ShowLength_Bytes() const;
1205
1208 if(m_parenthesisDrawMode != mode)
1210 m_parenthesisDrawMode = mode;
1211 }
1212
1213 void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
1214
1215 bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
1216
1217 void UseUnicodeMaths(bool useunicodemaths)
1218 { m_useUnicodeMaths = useunicodemaths; }
1219 bool UseUnicodeMaths() const {return m_useUnicodeMaths;}
1220
1225 const Style *GetStyle(TextStyle textStyle) const { return &m_styleStore[textStyle]; }
1233 Style *GetWritableStyle(TextStyle textStyle) { return &m_styleStore[textStyle]; }
1234
1241 wxScrolledCanvas *GetWorkSheet() const {return m_workSheet;}
1243 void SetWorkSheet(wxScrolledCanvas *workSheet);
1244
1252 DocumentCellPointers *GetDocumentCellPointers() const {return m_documentCellPointers;}
1254 void SetDocumentCellPointers(DocumentCellPointers *p) {m_documentCellPointers = p;}
1256 ViewCellPointers *GetViewCellPointers() const {return m_viewCellPointers;}
1258 void SetViewCellPointers(ViewCellPointers *p) {m_viewCellPointers = p;}
1259
1267 {if (m_recalculateRequest) m_recalculateRequest(group);}
1269 void SetRecalculateRequestCallback(std::function<void(GroupCell *)> callback)
1270 {m_recalculateRequest = std::move(callback);}
1271
1281 {if (m_recalculateAllRequest) m_recalculateAllRequest();}
1283 void SetRecalculateAllRequestCallback(std::function<void()> callback)
1284 {m_recalculateAllRequest = std::move(callback);}
1285
1286 long DefaultPort() const {return m_defaultPort;}
1287 void DefaultPort(long port){m_defaultPort = port;}
1288 bool GetAbortOnError() const {return m_abortOnError;}
1289 void SetAbortOnError(bool abortOnError) {m_abortOnError = abortOnError;}
1290
1291 long GetLanguage() const {return m_language;}
1292 void SetLanguage(long language) {m_language = language;}
1293
1295 long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
1296 void MaxGnuplotMegabytes(long megaBytes)
1297 {m_maxGnuplotMegabytes = megaBytes;}
1298
1299 bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
1300 void OfferKnownAnswers(bool offerKnownAnswers)
1301 {m_offerKnownAnswers = offerKnownAnswers;}
1302
1309 bool ScreenReaderAnnouncesMathML() const {return m_screenReaderAnnouncesMathML;}
1311 {m_screenReaderAnnouncesMathML = mathML;}
1312
1313 wxString Documentclass() const {return m_documentclass;}
1314 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
1315 wxString DocumentclassOptions() const {return m_documentclassOptions;}
1316 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
1317
1318
1319 htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
1320 void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
1321 {m_htmlEquationFormat = HTMLequationFormat;}
1322
1323 AFontSize GetDefaultFontSize() const { return m_styleStore[TS_CODE_DEFAULT].GetFontSize(); }
1324 AFontSize GetMathFontSize() const { return m_styleStore[TS_MATH].GetFontSize(); }
1325
1327 long GetAutosubscript_Num() const {return m_autoSubscript;}
1328 void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
1329 wxString GetAutosubscript_string() const;
1331 wxColor DefaultBackgroundColor();
1333 wxColor EditorBackgroundColor();
1335 bool ClipToDrawRegion() const {return m_renderContext.ClipToDrawRegion();}
1337 void ClipToDrawRegion(bool clipToDrawRegion){m_renderContext.ClipToDrawRegion(clipToDrawRegion);}
1338 void SetVisibleRegion(wxRect visibleRegion){
1339 if(m_renderContext.GetVisibleRegion().GetWidth() != visibleRegion.GetWidth())
1341 m_renderContext.SetVisibleRegion(visibleRegion);
1342 }
1343 wxRect GetVisibleRegion() const {return m_renderContext.GetVisibleRegion();}
1344 void SetWorksheetPosition(wxPoint worksheetPosition){m_renderContext.SetWorksheetPosition(worksheetPosition);}
1345 wxPoint GetWorksheetPosition() const {return m_renderContext.GetWorksheetPosition();}
1346 wxString MaximaShareDir() const {return m_maximaSession.ShareDir();}
1347 void MaximaShareDir(wxString dir){m_maximaSession.ShareDir(std::move(dir));}
1348 wxString MaximaDemoDir() const {return m_maximaSession.DemoDir();}
1349 void MaximaDemoDir(wxString dir){m_maximaSession.DemoDir(std::move(dir));}
1350 void InLispMode(bool lisp){m_maximaSession.InLispMode(lisp);}
1351 bool InLispMode() const {return m_maximaSession.InLispMode();}
1352 void BitmapScale(int factor){m_bitmapScale = factor;}
1353 int BitmapScale() const {return m_bitmapScale;}
1354 void DefaultPlotHeight(int px){m_defaultPlotHeight = px;}
1355 int DefaultPlotHeight() const {return m_defaultPlotHeight;}
1356 void DefaultPlotWidth(int px){m_defaultPlotWidth = px;}
1357 int DefaultPlotWidth() const {return m_defaultPlotWidth;}
1358 void DefaultFramerate(double fps){m_defaultFramerate = fps;}
1359 double DefaultFramerate() const {return m_defaultFramerate;}
1360 void TocDepth(int depth){m_tocDepth = depth;}
1361 int TocDepth() const {return m_tocDepth;}
1362 bool TeXExponentsAfterSubscript() const {return m_TeXExponentsAfterSubscript;}
1363 void TeXExponentsAfterSubscript(bool ExponentsAfterSubscript)
1364 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
1365 bool UsePartialForDiff() const {return m_usePartialForDiff;}
1366 void UsePartialForDiff(bool usePartialForDiff)
1367 {m_usePartialForDiff = usePartialForDiff;}
1375 {if (m_adjustWorksheetSizeRequest) m_adjustWorksheetSizeRequest();}
1377 void SetAdjustWorksheetSizeRequestCallback(std::function<void()> callback)
1378 {m_adjustWorksheetSizeRequest = std::move(callback);}
1380 void NotifyOfCellRedraw(const Cell *cell);
1390 void ReportMultipleRedraws();
1392 bool OfferInternalHelpBrowser() const;
1393 bool WrapLatexMath() const {return m_wrapLatexMath;}
1394 void WrapLatexMath(bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
1395 bool AllowNetworkHelp() const {return m_allowNetworkHelp;}
1396 void AllowNetworkHelp(bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
1397 bool ShowAllDigits() const {return m_showAllDigits;}
1398 void ShowAllDigits(bool shw){
1399 if(m_showAllDigits != shw)
1401 m_showAllDigits = shw;
1402 }
1403 bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
1404 void LineBreaksInLongNums(bool brk){
1405 if(m_lineBreaksInLongNums != brk)
1407 m_lineBreaksInLongNums = brk;
1408 }
1409 int MaxClipbrdBitmapMegabytes() const {return m_maxClipbrd_BitmapMegabytes;}
1410 void MaxClipbrdBitmapMegabytes(int maxClipbrd_BitmapMegabytes)
1411 {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
1412
1413 void MaximaUsesHtmlBrowser(bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1414 bool MaximaUsesHtmlBrowser() const {return m_maximaUsesHhtmlBrowser;}
1415 void MaximaUsesWxmaximaBrowser(bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1416 bool MaximaUsesWxmaximaBrowser() const {return m_maximaUsesWxmaximaBrowser && OfferInternalHelpBrowser();}
1417 void ExportContainsWXMX(bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1418 bool ExportContainsWXMX() const {return m_exportContainsWXMX;}
1419 void WizardTab(long tab){m_wizardTab = tab;}
1420 long WizardTab() const {return m_wizardTab;}
1421
1422 void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1423 bool Display2d_Unicode() const {return m_display2d_Unicode;}
1424
1425 #ifdef __WXMSW__
1426 bool UseWGnuplot() const {return m_useWgnuplot;}
1427 void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1428 #endif
1429 wxString TexPreamble() const {return m_texPreamble;}
1430 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1431
1432 void SetMaximaVersion(const wxString &version){m_maximaSession.SetMaximaVersion(version);}
1433 wxString GetMaximaVersion() const {return m_maximaSession.GetMaximaVersion();}
1434 void SetMaximaArch(const wxString &arch){m_maximaSession.SetMaximaArch(arch);}
1435 wxString GetMaximaArch() const {return m_maximaSession.GetMaximaArch();}
1436 void SetLispVersion(const wxString &version){m_maximaSession.SetLispVersion(version);}
1437 wxString GetLispVersion() const {return m_maximaSession.GetLispVersion();}
1438 void SetLispType(const wxString &type){m_maximaSession.SetLispType(type);}
1439 wxString GetLispType() const {return m_maximaSession.GetLispType();}
1440
1442 void InitStyles();
1444 bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT)
1445 { return m_fontRenderability.FontRendersChar(ch, font); }
1446
1448 const std::vector<TextStyle> &GetCodeStylesList() const {return m_styleStore.CodeStylesList();}
1450 const std::vector<TextStyle> &GetMathStylesList() const {return m_styleStore.MathStylesList();}
1452 const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_styleStore.ColorOnlyStylesList();}
1453 bool StyleAffectsCode(TextStyle style) const;
1454 bool StyleAffectsMathOut(TextStyle style) const;
1455 bool StyleAffectsColorOnly(TextStyle style) const;
1457 bool UpdateNeeded() const;
1459 static void SetDebugmode(){m_debugMode = true;}
1461 static bool GetDebugmode(){return m_debugMode;}
1462 maximaHelpFormat MaximaHelpFormat() const;
1463 void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1464
1465private:
1467 MaximaSessionInfo m_maximaSession;
1469 InitOpt m_initOpts;
1475 long m_configId;
1477 std::random_device m_rd;
1479 std::default_random_engine m_eng;
1480 wxEnvVariableHashMap m_maximaEnvVars;
1481public:
1483 std::random_device::result_type RandomEntropy(){return m_rd();}
1485 std::default_random_engine &RandomEngine(){return m_eng;}
1493 std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
1501 m_cellCfgCnt++;
1503 }
1504 static bool UseThreads(){return m_use_threads;}
1505 static void UseThreads(bool use){m_use_threads = use;}
1506 static void SetMaximaLang(const wxString &LANG){m_maxima_LANG = LANG;}
1507 static wxString GetMaximaLang(){return m_maxima_LANG;}
1508private:
1510 static wxString m_maxima_LANG;
1511 std::list<FileToSave> m_filesToSave;
1513 Styles m_styleStore;
1515 StringBoolHash m_hideMarkerForThisMessage;
1517 FontRenderabilityCache m_fontRenderability;
1518 mathDisplayMode m_displayMode = display_2d;
1519 static bool m_debugMode;
1520 bool m_showInputLabels;
1521 long m_wizardTab;
1522 bool m_display2d_Unicode;
1523 bool m_usePartialForDiff;
1524 bool m_maximaUsesHhtmlBrowser;
1525 bool m_maximaUsesWxmaximaBrowser;
1527 bool m_autoSaveAsTempFile;
1529 long m_language;
1531 bool m_autodetectMaxima;
1533 bool m_autodetectHelpBrowser;
1535 bool m_useInternalHelpBrowser;
1537 bool m_singlePageManual;
1539 bool m_incrementalSearch;
1541 long m_autoSubscript;
1543 wxScrolledCanvas *m_workSheet = nullptr;
1545 DocumentCellPointers *m_documentCellPointers = nullptr;
1547 ViewCellPointers *m_viewCellPointers = nullptr;
1549 std::function<void(GroupCell *)> m_recalculateRequest;
1551 std::function<void()> m_recalculateAllRequest;
1553 std::function<void()> m_adjustWorksheetSizeRequest;
1555 RenderContext m_renderContext;
1556 bool m_wrapLatexMath;
1557 bool m_allowNetworkHelp;
1558 bool m_exportContainsWXMX;
1559 wxString m_texPreamble;
1560
1561 drawMode m_parenthesisDrawMode;
1562 bool m_TeXExponentsAfterSubscript;
1563 wxString m_helpBrowserUserLocation;
1564 wxString m_maximaUserLocation;
1566 bool m_hideBrackets;
1568 bool m_overlayScrollbars;
1570 double m_printScale;
1571 double m_printMargin_Top;
1572 double m_printMargin_Bot;
1573 double m_printMargin_Left;
1574 double m_printMargin_Right;
1576 bool m_rightToLeftDocument;
1578 bool m_showBrackets;
1580 bool m_printBrackets;
1586 bool m_changeAsterisk;
1588 bool m_notifyIfIdle;
1590 bool m_findDialogDockable;
1592 bool m_mcpServerEnabled;
1594 int m_mcpServerPort;
1596 int m_aiChatProvider;
1597 wxString m_aiModelAnthropic;
1598 wxString m_aiModelOpenAI;
1599 wxString m_aiModelGoogle;
1600 wxString m_aiModelQwen;
1601 wxString m_aiModelGitHubModels;
1602 wxString m_aiModelDeepSeek;
1603 wxString m_aiModelOpenRouter;
1605 wxString m_aiCustomProvidersJson;
1607 wxString m_aiActiveCustomProviderId;
1609 long m_displayedDigits;
1611 long m_autoWrap;
1613 bool m_autoIndent;
1615 bool m_showAllDigits;
1617 bool m_lineBreaksInLongNums;
1619 bool m_matchParens;
1621 bool m_insertAns;
1623 bool m_openHCaret;
1625 long m_labelWidth;
1626 long m_indent;
1627 bool m_latin2greek;
1628 double m_zoomFactor;
1629 bool m_outdated;
1630 wxString m_maximaParameters;
1631 bool m_keepPercent;
1632 bool m_restartOnReEvaluation;
1633 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1634 long m_lineWidth_em;
1635 showLabels m_showLabelChoice;
1636 bool m_fixReorderedIndices;
1637 wxString m_mathJaxURL;
1638 bool m_mathJaxURL_UseUser;
1639 bool m_showCodeCells;
1640 bool m_copyBitmap;
1641 bool m_copyMathML;
1642 bool m_copyMathMLHTML;
1643 long m_showLength;
1644 bool m_usepngCairo;
1645 bool m_enterEvaluates;
1646 bool m_useSVG;
1647 bool m_fixedFontTC;
1648 bool m_copyRTF;
1649 bool m_copySVG;
1650 bool m_copyEMF;
1651 bool m_TOCshowsSectionNumbers;
1652 bool m_useUnicodeMaths;
1653 bool m_indentMaths;
1654 bool m_abortOnError;
1655 bool m_showMatchingParens;
1656 bool m_hidemultiplicationsign;
1657 bool m_offerKnownAnswers;
1658 bool m_screenReaderAnnouncesMathML;
1659 long m_defaultPort;
1660 long m_maxGnuplotMegabytes;
1661 long m_defaultPlotHeight;
1662 long m_defaultPlotWidth;
1663 bool m_saveUntitled;
1664 bool m_cursorJump;
1665 bool m_numpadEnterEvaluates;
1666 bool m_saveImgFileName;
1667 wxString m_documentclass;
1668 wxString m_documentclassOptions;
1669 htmlExportFormat m_htmlEquationFormat;
1670
1671 wxColour m_defaultBackgroundColor;
1672 wxBrush m_tooltipBrush;
1673 bool m_greekSidebar_ShowLatinLookalikes;
1674 #ifdef __WXMSW__
1675 bool m_useWgnuplot = false;
1676 #endif
1677 bool m_greekSidebar_Show_mu;
1678 wxString m_symbolPaneAdditionalChars;
1679 Appearance m_appearance = Appearance::followSystem;
1680 long m_recentItems;
1681 int m_bitmapScale;
1682 double m_defaultFramerate;
1683 int m_tocDepth;
1684 int m_maxClipbrd_BitmapMegabytes;
1685 int m_autoSaveMinutes;
1686 int m_maxLayoutTime;
1687 LayoutStrategy m_layoutStrategy = LayoutStrategy::layout2DIfFits;
1688 OversizedMatrices m_oversizedMatrices = OversizedMatrices::elide;
1690 bool m_oversizedMatricesOverridable = true;
1692 MatrixScrollHost *m_matrixScrollHost = nullptr;
1694 int m_worksheetTopOffset = 0;
1695 wxString m_wxMathML_Filename;
1696 maximaHelpFormat m_maximaHelpFormat;
1697 std::atomic<std::int_fast32_t> m_cellCfgCnt{0};
1698 static bool m_use_threads;
1699};
1700
1703{
1704public:
1705 explicit Printing(Configuration *configuration)
1706 {
1707 m_configuration = configuration;
1708 m_configuration->SetPrinting(true);
1709 }
1710 virtual ~Printing()
1711 {
1712 m_configuration->SetPrinting(false);
1713 }
1714private:
1715 Configuration * m_configuration;
1716};
1717
1720{
1721public:
1722 explicit NoClipToDrawRegion(Configuration *configuration)
1723 {
1724 m_configuration = configuration;
1725 m_configuration->ClipToDrawRegion(false);
1726 }
1727 virtual ~NoClipToDrawRegion()
1728 {
1729 m_configuration->ClipToDrawRegion(true);
1730 }
1731private:
1732 Configuration * m_configuration;
1733};
1734
1735#endif // CONFIGURATION_H
Declares FontRenderabilityCache: which chars can each font render?
This file declares a message dialog that sends its contents to the log message sink.
Declares MaximaSessionInfo: what we know about the connected Maxima.
Declares RenderContext: the per-render-pass state of a worksheet.
This file declares the class Styles.
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:230
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:99
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:148
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:932
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:948
The configuration storage for the current worksheet.
Definition: Configuration.h:100
void SetOversizedMatrices(OversizedMatrices mode, bool perMatrixOverridable=true)
Sets how oversized matrices are shown.
Definition: Configuration.h:529
void RecalculateForce()
Force every cell to be recalculated on the next layout pass.
Definition: Configuration.h:1500
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:362
wxString AiActiveCustomProviderId() const
Which custom provider is active, by AiCustomProviderConfig::id – meaningful only when AiChatProvider(...
Definition: Configuration.h:912
Appearance
How wxMaxima chooses between the light and the dark style set.
Definition: Configuration.h:1057
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:1144
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:982
long GetAsciiArtColumns() const
How many columns of the ASCII-art monospace font (TS_ASCIIMATHS) fit into GetLineWidth()?...
Definition: Configuration.cpp:1042
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:1327
void SetViewCellPointers(ViewCellPointers *p)
Register the transient view-state half of the cell-pointer registry.
Definition: Configuration.h:1258
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:1080
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:1129
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.h:1444
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:1177
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:290
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1461
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:788
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:344
static bool SystemIsDark()
Whether the OS reports a dark appearance (false where wx cannot tell).
Definition: Configuration.cpp:526
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:650
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:230
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:632
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:992
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:998
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:573
wxString AiModelAnthropic() const
The model id to request from each provider; defaults to AiProviderDefaultModel() but the user can ove...
Definition: Configuration.h:886
static const std::vector< ScalarSetting > & ScalarConfigSettings()
The single source of truth pairing each mechanical scalar setting's config key with the member cachin...
Definition: Configuration.cpp:1344
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:579
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:281
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:256
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:530
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:305
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:825
OversizedMatrices OversizedMatricesFor(std::optional< OversizedMatrices > requested) const
How one specific matrix that is too large for the window is shown.
Definition: Configuration.h:546
void RequestRecalculateAll() const
Ask the view to schedule a recalculation of the WHOLE worksheet.
Definition: Configuration.h:1280
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:538
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1010
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1132
bool McpServerEnabled() const
Run the MCP (Model Context Protocol) server, exposing the current worksheet's contents (cells,...
Definition: Configuration.h:842
int McpServerPort() const
Which localhost TCP port the MCP server listens on, if enabled.
Definition: Configuration.h:846
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:1092
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:1285
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:731
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:1138
void ClearMaximaEnvVars()
Forget all custom environment variables for the maxima process.
Definition: Configuration.h:199
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1462
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1450
DocumentCellPointers * GetDocumentCellPointers() const
The registry of special cells (selection, active cell, errors, ...) of this document.
Definition: Configuration.h:1252
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:978
bool UseDarkMode() const
Whether the dark style set is currently active.
Definition: Configuration.h:1068
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:1121
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:1233
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:390
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1164
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:204
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:405
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1493
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:1088
bool FindDialogDockable() const
Show "Find and Replace" as a dockable sidebar instead of a floating dialog?
Definition: Configuration.h:831
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:1110
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:993
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:1134
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:358
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:594
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:1140
wxString AiApiKeyGitHubModels() const
A GitHub personal access token (fine-grained, "Models: read" permission) – see AiProviderKind::GitHub...
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:665
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1125
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:567
static const std::vector< std::pair< TextStyle, wxString > > & StyleConfigKeys()
The single source of truth mapping each persisted text style to its config-key prefix.
Definition: Configuration.cpp:1455
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:250
MatrixScrollHost * GetMatrixScrollHost() const
What gives a scrolling matrix its scrollbars, if anything.
Definition: Configuration.h:558
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:659
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:394
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:241
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:325
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:213
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:456
void SetRecalculateAllRequestCallback(std::function< void()> callback)
Set the callback RequestRecalculateAll() / RecalculateForce() notify through.
Definition: Configuration.h:1283
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:206
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:1295
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:465
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:1147
void SetWorksheetTopOffset(int offset)
Sets the extra top margin.
Definition: Configuration.h:453
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:209
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:727
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1448
static const wxString CharsNeedingQuotes()
Returns a list of chars we need to escape in maxima.
Definition: Configuration.h:375
void SetAppearance(Appearance a)
Choose the appearance and update which style set is active.
Definition: Configuration.h:1060
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:1164
bool RightToLeftDocument() const
Does the document read right-to-left (Arabic, Hebrew, Persian, Urdu)?
Definition: Configuration.h:1021
void UpdateBackgroundBrush()
Refresh the cached document-background brush from the active style set.
Definition: Configuration.cpp:562
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:1107
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:791
std::random_device::result_type RandomEntropy()
One sample of OS entropy (std::random_device).
Definition: Configuration.h:1483
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:329
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:519
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1459
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:277
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:1105
wxScrolledCanvas * GetWorkSheet() const
Get the worksheet canvas this configuration storage is valid for.
Definition: Configuration.h:1241
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:1335
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1079
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:1032
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:1158
void AddMaximaOperator(const wxString &name)
Register name as an operator known to maxima.
Definition: Configuration.h:196
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:772
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:254
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:477
bool GetAutoWrapCode() const
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:636
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1019
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:252
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:541
void RequestAdjustWorksheetSize() const
Ask the view (if any) to re-adjust its worksheet (scroll) size.
Definition: Configuration.h:1374
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:299
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:1124
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1294
bool OverlayScrollbars() const
Use GTK's overlay scrollbars on the worksheet?
Definition: Configuration.h:318
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:1337
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1266
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:423
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:264
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:606
void MakeTemporary()
Makes this configuration temporary.
Definition: Configuration.h:235
std::default_random_engine & RandomEngine()
The pseudo-random engine, e.g. to feed a distribution.
Definition: Configuration.h:1485
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:309
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:585
ViewCellPointers * GetViewCellPointers() const
The transient view-state half of the cell-pointer registry (null if none).
Definition: Configuration.h:1256
int GetWorksheetTopOffset() const
An extra top margin of less than one scroll unit, in px.
Definition: Configuration.h:447
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1273
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:620
void SetRecalculateRequestCallback(std::function< void(GroupCell *)> callback)
Set the callback RequestRecalculate() notifies the view through.
Definition: Configuration.h:1269
InitOpt
Definition: Configuration.h:179
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:181
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:1132
bool ScreenReaderAnnouncesMathML() const
Announce maxima's output to screen readers as MathML?
Definition: Configuration.h:1309
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:1207
drawMode
Definition: Configuration.h:173
@ ascii
Use ascii characters only.
Definition: Configuration.h:174
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:175
void OverlayScrollbars(bool overlay)
Define if the worksheet should use GTK's overlay scrollbars.
Definition: Configuration.h:322
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:997
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:1112
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:986
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:1202
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:250
OversizedMatrices
How to show a matrix too large for the window.
Definition: Configuration.h:506
@ scroll
Show a window-sized part of it, with native scrollbars.
@ elide
Leave out the middle rows/columns, marking the gap with ⋯ ⋮ ⋱ (the default)
@ showInFull
Draw it whole; the worksheet grows, and scrolls, to fit it.
int AiChatProvider() const
Which AI provider the AI chat sidebar talks to, as an AiProviderKind cast to int (0 = AiProviderKind:...
Definition: Configuration.h:853
void SetMaximaEnvVar(const wxString &name, const wxString &value)
Set a custom environment variable for the maxima process.
Definition: Configuration.h:201
wxString AiCustomProvidersJson() const
User-added custom providers (beyond the four built-in ones), as a JSON array – see AiCustomProviderCo...
Definition: Configuration.h:906
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1136
void SetMatrixScrollHost(MatrixScrollHost *host)
Sets the scrollbar host.
Definition: Configuration.h:566
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:147
@ mathML_mathJaX
Native MathML, plus MathJaX downloaded as a fall-back only for the few browsers that still lack MathM...
Definition: Configuration.h:155
@ mathJaX_TeX
Deprecated: the TeX-via-MathJaX HTML export was removed. The value is kept so saved configurations mi...
Definition: Configuration.h:151
@ mathML
Native MathML with no MathJaX at all: the exported page makes no external requests....
Definition: Configuration.h:159
void SetAdjustWorksheetSizeRequestCallback(std::function< void()> callback)
Set the callback RequestAdjustWorksheetSize() notifies the view through.
Definition: Configuration.h:1377
void SetDocumentCellPointers(DocumentCellPointers *p)
Register the document-model half of the cell-pointer registry.
Definition: Configuration.h:1254
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:1084
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1306
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1480
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:919
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:1225
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:1127
void SetWorkSheet(wxScrolledCanvas *workSheet)
Set the worksheet canvas this configuration storage is valid for.
Definition: Configuration.cpp:221
wxString AiApiKeyAnthropic() const
The user's API key for each provider, kept separate so switching providers in Options doesn't lose th...
bool IsOperator(wxString name) const
Coincides name with a operator known to maxima?
Definition: Configuration.h:194
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:1198
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:397
void RequestRecalculate(GroupCell *group) const
Ask the view (if any) to recalculate the layout starting at the given group cell.
Definition: Configuration.h:1266
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1452
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:1043
The document-model half of the cell-pointer registry.
Definition: CellPointers.h:52
Caches which characters each font can actually render.
Definition: FontRenderabilityCache.h:65
bool FontRendersChar(wxUniChar ch, const wxFont &font)
True if we are confident that the font renders this char.
Definition: FontRenderabilityCache.cpp:32
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
Whatever can give a matrix real scrollbars.
Definition: MatrixScrollHost.h:46
What we know about the Maxima instance we are talking to.
Definition: MaximaSessionInfo.h:48
wxString GetWorkingDirectory() const
Maxima's working directory.
Definition: MaximaSessionInfo.h:95
bool InLispMode() const
Is maxima currently in lisp mode (where commands need no trailing ";")?
Definition: MaximaSessionInfo.h:108
void SetLispType(const wxString &type)
Sets the type of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:92
void SetMaximaArch(const wxString &arch)
Sets the processor architecture the connected Maxima runs on.
Definition: MaximaSessionInfo.h:84
wxString GetMaximaArch() const
The processor architecture the connected Maxima runs on.
Definition: MaximaSessionInfo.h:82
wxString GetLispVersion() const
The version of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:86
wxString DemoDir() const
The directory maxima's demo files live in.
Definition: MaximaSessionInfo.h:103
void AddOperator(const wxString &name)
Registers name as an operator known to maxima.
Definition: MaximaSessionInfo.h:75
void SetWorkingDirectory(wxString dir)
Sets maxima's working directory.
Definition: MaximaSessionInfo.h:97
wxString ShareDir() const
The directory maxima's shared files (e.g. the manual) live in.
Definition: MaximaSessionInfo.h:99
wxString GetLispType() const
The type of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:90
void SetMaximaVersion(const wxString &version)
Sets the version of the connected Maxima.
Definition: MaximaSessionInfo.h:80
void SetLispVersion(const wxString &version)
Sets the version of the lisp the connected Maxima runs on.
Definition: MaximaSessionInfo.h:88
wxString GetMaximaVersion() const
The version of the connected Maxima.
Definition: MaximaSessionInfo.h:78
bool IsOperator(const wxString &name) const
Is this name an operator known to maxima?
Definition: MaximaSessionInfo.h:72
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1720
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1703
The state of the current worksheet render pass.
Definition: RenderContext.h:60
void SetRecalcDC(wxDC *dc)
Tells us which dc to measure text sizes on.
Definition: RenderContext.h:79
void SetWorksheetPosition(wxPoint worksheetPosition)
Sets where the worksheet is to be drawn.
Definition: RenderContext.h:170
void ClearLayoutCancelled()
Stops the layout deadline and clears the cancelled flag.
Definition: RenderContext.h:187
wxRect GetUpdateRegion() const
The rectangle of the worksheet that is currently being redrawn.
Definition: RenderContext.h:105
void SetVisibleRegion(wxRect visibleRegion)
Sets the rectangle of the worksheet that is currently visible.
Definition: RenderContext.h:112
bool ClipToDrawRegion() const
Do we want to omit drawing outside the current update region?
Definition: RenderContext.h:162
bool Printing() const
Are we currently rendering for the printer rather than the screen?
Definition: RenderContext.h:115
void SetLayoutDeadline(int seconds)
Starts a layout deadline this many seconds in the future.
Definition: RenderContext.h:179
wxBrush GetBackgroundBrush() const
The brush the worksheet's background is painted with.
Definition: RenderContext.h:174
void SetCanvasSize(wxSize siz)
Sets the size of the worksheet's visible window.
Definition: RenderContext.h:102
bool IsLayoutCancelled() const
Has the current layout pass exceeded its deadline?
Definition: RenderContext.h:193
wxDC * GetRecalcDC() const
The dc "recalculate" (measuring text) currently draws to.
Definition: RenderContext.h:77
wxPoint GetWorksheetPosition() const
Where is the worksheet to be drawn?
Definition: RenderContext.h:168
wxSize GetCanvasSize() const
The size of the worksheet's visible window.
Definition: RenderContext.h:100
wxRect GetVisibleRegion() const
The rectangle of the worksheet that is currently visible.
Definition: RenderContext.h:110
void SetUpdateRegion(wxRect rect)
Sets the rectangle of the worksheet that is currently being redrawn.
Definition: RenderContext.h:107
Text Style Definition.
Definition: TextStyle.h:67
Storage for the worksheet's per-TextStyle text styles.
Definition: Styles.h:42
const std::vector< TextStyle > & ColorOnlyStylesList() const
The styles where only the color is configurable.
Definition: Styles.h:107
const std::vector< TextStyle > & MathStylesList() const
The styles that share the 2d-math font.
Definition: Styles.h:105
const std::vector< TextStyle > & CodeStylesList() const
The styles that share the code-default font/attributes.
Definition: Styles.h:103
void SetUseDark(bool dark)
Select which set indexing/iteration return.
Definition: Styles.h:57
The view/interaction half of the cell-pointer registry.
Definition: CellPointers.h:258
Definition: CellPointers.h:34
Definition: Configuration.h:102
std::atomic< long > worksheetRepaints
How often the worksheet was repainted (Worksheet::OnPaint ran)
Definition: Configuration.h:127
std::atomic< long > cellsDrawnAtWrongFontSize
How many cells were drawn at a different font size than they were laid out with.
Definition: Configuration.h:125
std::atomic< long > worksheetFullRepaints
How many of those repaints covered (nearly) the whole visible worksheet.
Definition: Configuration.h:135
One mechanically persisted scalar setting: its config key and the member variable it is stored in.
Definition: Configuration.h:702
const wxChar * key
The key the setting is stored under in the configuration store.
Definition: Configuration.h:704
std::variant< bool Configuration::*, int Configuration::*, long Configuration::*, double Configuration::*, wxString Configuration::* > member
Which member of Configuration holds the setting's cached value.
Definition: Configuration.h:709