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 <utility>
46#include <variant>
47#include <vector>
48#include <algorithm>
49#include <atomic>
50#include <chrono>
51#include <wx/wupdlock.h>
52#include <list>
53
54#define MC_LINE_SKIP Scale_Px(2)
55#define MC_TEXT_PADDING Scale_Px(1)
56
57#define PAREN_OPEN_TOP_UNICODE "\u239b"
58#define PAREN_OPEN_EXTEND_UNICODE "\u239c"
59#define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
60#define PAREN_CLOSE_TOP_UNICODE "\u239e"
61#define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
62#define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
63#define SUM_SIGN "\u2211"
64#define PROD_SIGN "\u220F"
66#define SUM_DEC 2
67
69#define MC_HCARET_WIDTH 25
70
71#define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
72static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
73static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
74
75// The minimal and maximal label width
76#define LABELWIDTH_MIN 3
77#define LABELWIDTH_MAX 10
78class Cell;
81class GroupCell;
83template<class T> class wxScrolled;
85
101{
102public:
104 std::atomic<long> manualAnchorsFromBuiltin{0};
105 std::atomic<long> manualAnchorsFromCache{0};
106 std::atomic<long> manualAnchorsCompiled{0};
107 std::atomic<long> maximaProcessesSpawned{0};
108 std::atomic<long> fontCacheHits{0};
109 std::atomic<long> fontCacheMisses{0};
110 std::atomic<long> recalculationNeeded_FontInvalid{0};
111 std::atomic<long> recalculationNeeded_SizeInvalid{0};
112 std::atomic<long> recalculationNeeded_FontMismatch{0};
113 std::atomic<long> recalculationNeeded_ConfigChanged{0};
114 std::atomic<long> recalculationNeeded_CellsAppended{0};
115 std::atomic<long> recalculationNeeded_EditorDirty{0};
116 std::atomic<long> cellsConvertedToLinear{0};
117 std::atomic<long> cellsConvertedTo2D{0};
126 std::atomic<long> cellsDrawnAtWrongFontSize{0};
128 std::atomic<long> worksheetRepaints{0};
136 std::atomic<long> worksheetFullRepaints{0};
137 void Report() const;
138 };
139 static PerformanceStats g_stats;
140
143 {
148 bitmap = 1,
152 svg = 3,
156 html_export_invalidChoice
157 };
158
159 enum showLabels : int8_t
160 {
161 labels_automatic = 0,
162 labels_prefer_user = 1,
163 labels_useronly = 2,
164 labels_none = 3,
165 labels_invalidSelection
166 };
167
169 {
171 handdrawn
172 };
173
175 {
176 none,
177 temporary
178 };
179
180 enum mathDisplayMode
181 {
182 display_2d,
183 display_2dASCII,
184 display_2dUNICODE,
185 display_1dASCII
186 };
187
188 using StringBoolHash = std::unordered_map<wxString, bool, wxStringHash>;
190 bool IsOperator(wxString name) const {return m_maximaSession.IsOperator(name);}
192 void AddMaximaOperator(const wxString &name){m_maximaSession.AddOperator(name);}
193 const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
195 void ClearMaximaEnvVars(){m_maximaEnvVars.clear();}
197 void SetMaximaEnvVar(const wxString &name, const wxString &value){m_maximaEnvVars[name] = value;}
198
200 mathDisplayMode DisplayMode() const {return m_displayMode;}
202 void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
203
205 void SetWorkingDirectory(wxString dir)
206 { m_maximaSession.SetWorkingDirectory(std::move(dir)); }
207
209 wxString GetWorkingDirectory() const
210 { return m_maximaSession.GetWorkingDirectory(); }
211
213 void ReadConfig();
214
219 explicit Configuration(wxDC *dc = {}, InitOpt options = none);
221
231 void MakeTemporary() { m_initOpts = temporary; }
232
234 void ResetAllToDefaults();
235
237 void SetRecalcContext(wxDC &dc)
238 {
239 m_renderContext.SetRecalcDC(&dc);
240 }
241 void UnsetContext() {m_renderContext.SetRecalcDC(nullptr);}
242
244 void SetBackgroundBrush(const wxBrush &brush);
246 bool FixedFontInTextControls() const {return m_fixedFontTC;}
248 void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
250 wxBrush GetBackgroundBrush() const {return m_renderContext.GetBackgroundBrush();}
256 wxBrush GetTooltipBrush() const;
267 static wxColour TooltipMarkerColour(const wxColour &background);
268
269 virtual ~Configuration();
270
276
277 using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
278 using EscCodeIterator = EscCodeContainer::const_iterator;
279
281 static const wxString &GetEscCode(const wxString &key);
283 static EscCodeIterator EscCodesBegin();
285 static EscCodeIterator EscCodesEnd();
286
288 static double GetMinZoomFactor()
289 { return 0.1; }
290
292 static double GetMaxZoomFactor()
293 { return 32.0; }
294
301 double GetInterEquationSkip() const
302 {
304 return 0;
305 else
306 return GetZoomFactor() * m_styleStore[TS_MATH].GetFontSize() / 2;
307 }
308
310 wxCoord GetCellBracketWidth() const
311 {
312 return static_cast<wxCoord>(GetZoomFactor() * 16);
313 }
314
316 bool HideBrackets() const
317 { return m_hideBrackets; }
318
320 void HideBrackets(bool hide){m_hideBrackets = hide;}
321
329 bool OverlayScrollbars() const
330 { return m_overlayScrollbars; }
331
333 void OverlayScrollbars(bool overlay){m_overlayScrollbars = overlay;}
334
336 double PrintScale() const
337 { return m_printScale; }
338
340 void PrintScale(double scale){m_printScale = scale;}
341
342 void PrintMargin_Top(double margin){m_printMargin_Top = margin;}
343 void PrintMargin_Bot(double margin){m_printMargin_Bot = margin;}
344 void PrintMargin_Left(double margin){m_printMargin_Left = margin;}
345 void PrintMargin_Right(double margin){m_printMargin_Right = margin;}
346 double PrintMargin_Top() const {return m_printMargin_Top;}
347 double PrintMargin_Bot() const {return m_printMargin_Bot;}
348 double PrintMargin_Left() const {return m_printMargin_Left;}
349 double PrintMargin_Right() const {return m_printMargin_Right;}
350
352 void SetZoomFactor(double newzoom);
353
355 void SetZoomFactor_temporarily(double newzoom){
356 if(m_zoomFactor != newzoom)
358 m_zoomFactor = newzoom;
359 }
360
365 wxCoord Scale_Px(double px) const;
366 AFontSize Scale_Px(AFontSize size) const;
367
369 double GetZoomFactor() const
370 { return m_zoomFactor; }
371
373 wxDC *GetRecalcDC() const
374 { return m_renderContext.GetRecalcDC(); }
375
376 void SetRecalcDC(wxDC *dc)
377 { m_renderContext.SetRecalcDC(dc); }
378
379 wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
380
381 // cppcheck-suppress functionStatic
382 // cppcheck-suppress functionConst
383 wxString GetSymbolFontName() const;
384
386 static const wxString CharsNeedingQuotes()
387 {
388 return wxString(wxS("°,\\'\"()[]-{}^+*/&§?:;=#<>$"));
389 }
390
391 wxFontWeight IsBold(long st) const;
392
393 wxFontStyle IsItalic(long st) const;
394
395 bool IsUnderlined(long st) const {return m_styleStore[st].IsUnderlined();}
396
401 wxCoord GetLabelWidth() const
402 { return m_labelWidth * 14; }
403
405 long LabelWidth() const
406 { return m_labelWidth; }
408 void LabelWidth(long labelWidth)
409 {
410 if(m_labelWidth != labelWidth)
412 m_labelWidth = labelWidth;
413 }
414
416 wxCoord GetIndent() const
417 {
418 if (m_indent < 0)
419 return 3 * GetCellBracketWidth() / 2;
420 else
421 return m_indent;
422 }
423
429 wxSize GetPPI() const;
430 int AutosaveMinutes() const {return m_autoSaveMinutes;}
431 void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
432
434 long GetCursorWidth() const
435 {
436 long ppi;
437
438 if(!GetPrinting())
439 ppi = GetPPI().x;
440 else
441 ppi = 96;
442
443 if (ppi / 45 < 1)
444 return 1;
445 else
446 return ppi / 45;
447 }
448
458 int GetWorksheetTopOffset() const { return m_worksheetTopOffset; }
464 void SetWorksheetTopOffset(int offset) { m_worksheetTopOffset = offset; }
465
467 long GetBaseIndent() const
468 {
469 if (GetCursorWidth() < 12)
470 return 12;
471 else
472 return 4 + GetCursorWidth();
473 }
474
476 long GetGroupSkip() const
477 {
478 if (GetCursorWidth() < 10)
479 return 20;
480 else
481 return 10 + GetCursorWidth();
482 }
483
488 void SetIndent(long indent)
489 {
490 if(m_indent != indent)
492 m_indent = indent;
493 }
494
495 bool IncrementalSearch() const {return m_incrementalSearch;}
496
497
498 void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
499
500 int MaxLayoutTime() const { return m_maxLayoutTime; }
501 void MaxLayoutTime(int time) { m_maxLayoutTime = time; }
502
503 enum class LayoutStrategy {
504 layout2DWheneverPossible = 0,
505 layout2DIfFits = 1,
506 layoutPrefer1D = 2
507 };
508 LayoutStrategy GetLayoutStrategy() const { return m_layoutStrategy; }
509 void SetLayoutStrategy(LayoutStrategy s) { m_layoutStrategy = s; }
510
517 enum class OversizedMatrices {
519 showInFull = 0,
521 elide = 1,
528 scroll = 2
529 };
530 OversizedMatrices GetOversizedMatrices() const { return m_oversizedMatrices; }
540 void SetOversizedMatrices(OversizedMatrices mode, bool perMatrixOverridable = true) {
541 if ((mode != m_oversizedMatrices) ||
542 (perMatrixOverridable != m_oversizedMatricesOverridable))
544 m_oversizedMatrices = mode;
545 m_oversizedMatricesOverridable = perMatrixOverridable;
546 }
557 OversizedMatrices OversizedMatricesFor(std::optional<OversizedMatrices> requested) const {
558 if (requested && m_oversizedMatricesOverridable)
559 return *requested;
560 return m_oversizedMatrices;
561 }
562
569 enum class ImageBackdrop {
571 none = 0,
575 always = 2
576 };
577 ImageBackdrop GetImageBackdrop() const { return m_imageBackdrop; }
578 void SetImageBackdrop(ImageBackdrop mode) { m_imageBackdrop = mode; }
584 switch (m_imageBackdrop) {
586 return true;
588 return !GetPrinting() && (DefaultBackgroundColor().GetLuminance() < 0.5);
590 break;
591 }
592 return false;
593 }
594
601 MatrixScrollHost *GetMatrixScrollHost() const { return m_matrixScrollHost; }
609 void SetMatrixScrollHost(MatrixScrollHost *host) { m_matrixScrollHost = host; }
610
611 void SetLayoutDeadline(int seconds) {
612 m_renderContext.SetLayoutDeadline(seconds);
613 }
614 void ClearLayoutCancelled() {
615 m_renderContext.ClearLayoutCancelled();
616 }
617 bool IsLayoutCancelled() const {
618 return m_renderContext.IsLayoutCancelled();
619 }
620
623 {
625 }
626
628 double GetDefaultLineWidth() const
629 {
630 if (GetZoomFactor() < 1.0)
631 return 1.0;
632 else
633 return GetZoomFactor();
634 }
635
637 long LineWidth_em() const
638 {
639 if(!GetPrinting())
640 return m_lineWidth_em;
641 else
642 return 10000;
643 }
644
645 bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
646 void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
647
649 void LineWidth_em(long width)
650 { m_lineWidth_em = width; }
651
653 // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
654 // But text blocks that are 1 meter wide and 2 cm high feel - weird.
655 long GetLineWidth() const;
656
660 long GetAsciiArtColumns() const;
661
662 bool SaveUntitled() const { return m_saveUntitled;}
663 void SaveUntitled(bool save) {m_saveUntitled = save;}
664
665 bool CursorJump() const { return m_cursorJump;}
666 void CursorJump(bool save){m_cursorJump = save;}
667
675 bool ArrowKeysSkipOutput() const { return m_arrowKeysSkipOutput;}
676 void ArrowKeysSkipOutput(bool skip){m_arrowKeysSkipOutput = skip;}
677
678 bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
679 void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
680
681 bool SaveImgFileName() const { return m_saveImgFileName;}
682 void SaveImgFileName(bool save) { m_saveImgFileName = save;}
683
685 bool GetAutoWrap() const
686 { return m_autoWrap > 0; }
687
689 bool GetAutoWrapCode() const
690 { return m_autoWrap > 1; }
691
703 void SetAutoWrap(long autoWrap){
704 m_autoWrap = autoWrap;
705 if (m_autoWrap < 0)
706 m_autoWrap = 0;
707 if (m_autoWrap > 2)
708 m_autoWrap = 1;
709 }
710
712 bool GetAutoIndent() const
713 { return m_autoIndent; }
714
715 void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
716
718 bool IndentMaths() const {return m_indentMaths;}
719 void IndentMaths(bool indent){
720 if(m_indentMaths != indent)
722 m_indentMaths = indent;}
723 AFontSize GetFontSize(TextStyle st) const { return m_styleStore[st].GetFontSize(); }
724
725 static const wxString &GetStyleName(TextStyle textStyle);
726
732 void ReadStyles(const wxString &file = {});
733
738 void WriteStyles(const wxString &file = {});
739 void WriteStyles(wxConfigBase *config);
740 void WriteSettings(const wxString &file = {});
748 static const std::vector<std::pair<TextStyle, wxString>> &StyleConfigKeys();
749
757 const wxChar *key;
759 std::variant<bool Configuration::*, int Configuration::*,
760 long Configuration::*, double Configuration::*,
761 wxString Configuration::*>
763 };
774 static const std::vector<ScalarSetting> &ScalarConfigSettings();
775 void MakeStylesConsistent();
776 void Outdated(bool outdated)
777 { m_outdated = outdated; }
778
780 bool CheckKeepPercent() const
781 { return m_keepPercent; }
782
784 void SetKeepPercent(bool keepPercent)
785 {
786 if(m_keepPercent != keepPercent)
788 m_keepPercent = keepPercent;
789 }
790
791 wxString GetTeXCMRI() const
792 { return m_fontCMRI; }
793
794 wxString GetTeXCMSY() const
795 { return m_fontCMSY; }
796
797 wxString GetTeXCMEX() const
798 { return m_fontCMEX; }
799
800 wxString GetTeXCMMI() const
801 { return m_fontCMMI; }
802
803 wxString GetTeXCMTI() const
804 { return m_fontCMTI; }
805
806 bool ShowCodeCells() const
807 { return m_showCodeCells; }
808
809 void ShowCodeCells(bool show);
810
817 void SetPrinting(bool printing);
818
825 bool GetPrinting() const
826 { return m_renderContext.Printing(); }
827
829 wxColour GetColor(TextStyle style);
830
831
832 bool UsePngCairo() const { return m_usepngCairo;}
833 void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
834
835 bool GetMatchParens() const { return m_matchParens; }
836 void SetMatchParens(bool matchParens) { m_matchParens = matchParens; }
837 bool ShowMatchingParens() const { return m_showMatchingParens; }
838 void ShowMatchingParens(bool show) { m_showMatchingParens = show; }
839
841 bool GetChangeAsterisk() const{ return m_changeAsterisk; }
842
844 void SetChangeAsterisk(bool changeAsterisk) {
845 if(m_changeAsterisk != changeAsterisk)
847 m_changeAsterisk = changeAsterisk;
848 }
849
850 bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
851
852 void HidemultiplicationSign(bool show) {
853 if(m_hidemultiplicationsign != show)
855 m_hidemultiplicationsign = show;
856 }
857
858 bool Latin2Greek() const
859 {return m_latin2greek;}
860
861 void Latin2Greek(bool latin2greek) {
862 if(m_latin2greek != latin2greek)
864 m_latin2greek = latin2greek;
865 }
866
867 bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
868 void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
869
870 bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
871 void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
872
873 wxString SymbolPaneAdditionalChars() const
874 {return m_symbolPaneAdditionalChars;}
875 void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
876
878 bool NotifyIfIdle() const
879 { return m_notifyIfIdle; }
880
881 void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
882
885 { return m_findDialogDockable; }
886
887 void FindDialogDockable(bool dockable) {m_findDialogDockable = dockable;}
888
895 bool McpServerEnabled() const { return m_mcpServerEnabled; }
896 void McpServerEnabled(bool enabled) { m_mcpServerEnabled = enabled; }
897
899 int McpServerPort() const { return m_mcpServerPort; }
900 void McpServerPort(int port) { m_mcpServerPort = port; }
901
906 int AiChatProvider() const { return m_aiChatProvider; }
907 void AiChatProvider(int provider) { m_aiChatProvider = provider; }
908
918 wxString AiApiKeyAnthropic() const;
919 void AiApiKeyAnthropic(const wxString &key);
920 wxString AiApiKeyOpenAI() const;
921 void AiApiKeyOpenAI(const wxString &key);
922 wxString AiApiKeyGoogle() const;
923 void AiApiKeyGoogle(const wxString &key);
924 wxString AiApiKeyQwen() const;
925 void AiApiKeyQwen(const wxString &key);
929 wxString AiApiKeyGitHubModels() const;
930 void AiApiKeyGitHubModels(const wxString &key);
931 wxString AiApiKeyDeepSeek() const;
932 void AiApiKeyDeepSeek(const wxString &key);
933 wxString AiApiKeyOpenRouter() const;
934 void AiApiKeyOpenRouter(const wxString &key);
935
939 wxString AiModelAnthropic() const { return m_aiModelAnthropic; }
940 void AiModelAnthropic(const wxString &model) { m_aiModelAnthropic = model; }
941 wxString AiModelOpenAI() const { return m_aiModelOpenAI; }
942 void AiModelOpenAI(const wxString &model) { m_aiModelOpenAI = model; }
943 wxString AiModelGoogle() const { return m_aiModelGoogle; }
944 void AiModelGoogle(const wxString &model) { m_aiModelGoogle = model; }
945 wxString AiModelQwen() const { return m_aiModelQwen; }
946 void AiModelQwen(const wxString &model) { m_aiModelQwen = model; }
947 wxString AiModelGitHubModels() const { return m_aiModelGitHubModels; }
948 void AiModelGitHubModels(const wxString &model) { m_aiModelGitHubModels = model; }
949 wxString AiModelDeepSeek() const { return m_aiModelDeepSeek; }
950 void AiModelDeepSeek(const wxString &model) { m_aiModelDeepSeek = model; }
951 wxString AiModelOpenRouter() const { return m_aiModelOpenRouter; }
952 void AiModelOpenRouter(const wxString &model) { m_aiModelOpenRouter = model; }
953
959 wxString AiCustomProvidersJson() const { return m_aiCustomProvidersJson; }
960 void AiCustomProvidersJson(const wxString &json) { m_aiCustomProvidersJson = json; }
961
965 wxString AiActiveCustomProviderId() const { return m_aiActiveCustomProviderId; }
966 void AiActiveCustomProviderId(const wxString &id) { m_aiActiveCustomProviderId = id; }
967
973 { return m_displayedDigits; }
974
975 void SetDisplayedDigits(long displayedDigits)
976 {
977 wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
978 if(m_displayedDigits != displayedDigits)
980 m_displayedDigits = displayedDigits;
981 }
982
985 {
986 public:
987 FileToSave(const wxString &filename, const wxMemoryBuffer &data):
988 m_data(data),
989 m_filename(filename)
990 {
991 }
992 const wxString FileName() const{return m_filename;}
993 const wxMemoryBuffer Data() const{return m_data;}
994 private:
995 const wxMemoryBuffer m_data;
996 const wxString m_filename;
997 };
998
1001 {
1002 public:
1003 TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
1004 m_pos(pos),
1005 m_text(text),
1006 m_color(color)
1007 {
1008 }
1009 const wxPoint Pos() const{return m_pos;}
1010 const wxString Text() const{return m_text;}
1011 const wxColor Color() const{return m_color;}
1012 private:
1013 const wxPoint m_pos;
1014 const wxString m_text;
1015 const wxColor m_color;
1016 };
1017
1018 void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
1019 { m_filesToSave.emplace_front(FileToSave(filename, data)); }
1020
1021 wxRect GetUpdateRegion() const {return m_renderContext.GetUpdateRegion();}
1022 const std::list<FileToSave> &GetFilesToSave() const {return m_filesToSave;}
1023 void ClearFilesToSave () { m_filesToSave.clear();}
1030 std::list<FileToSave> TakeFilesToSave() { return std::exchange(m_filesToSave, {}); }
1032 void SetFilesToSave(std::list<FileToSave> files) { m_filesToSave = std::move(files); }
1033 void SetUpdateRegion(wxRect rect){m_renderContext.SetUpdateRegion(rect);}
1034
1037 bool InUpdateRegion(wxRect rect) const;
1038
1039 bool GetInsertAns() const
1040 { return m_insertAns; }
1041
1042 void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
1043
1044 bool GetOpenHCaret() const
1045 { return m_openHCaret; }
1046
1047 void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
1048
1049 bool RestartOnReEvaluation() const
1050 { return m_restartOnReEvaluation; }
1051
1052 void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
1053
1055 wxSize GetCanvasSize() const
1056 { return m_renderContext.GetCanvasSize(); }
1057
1059 void SetCanvasSize(wxSize siz)
1060 {
1061 if(GetCanvasSize().GetWidth() != siz.GetWidth() ||
1062 GetCanvasSize().GetHeight() != siz.GetHeight())
1064 m_renderContext.SetCanvasSize(siz);
1065 }
1066
1084 { return m_rightToLeftDocument; }
1085
1086 bool RightToLeftDocument(bool rightToLeft)
1087 {
1088 if (m_rightToLeftDocument != rightToLeft)
1090 return m_rightToLeftDocument = rightToLeft;
1091 }
1092
1094 bool ShowBrackets() const
1095 { return m_showBrackets; }
1096
1097 bool ShowBrackets(bool show)
1098 {
1099 if(m_showBrackets != show)
1101 return m_showBrackets = show;
1102 }
1103
1105 bool PrintBrackets() const
1106 { return m_printBrackets; }
1107
1108 showLabels GetLabelChoice() const
1109 { return m_showLabelChoice; }
1110
1111 bool ShowInputLabels() const {return m_showInputLabels;}
1112 void ShowInputLabels(bool show) {
1113 if(m_showInputLabels != show)
1115 m_showInputLabels = show;
1116 }
1117
1119 enum class Appearance { light, dark, followSystem };
1120 Appearance GetAppearance() const { return m_appearance; }
1123 m_appearance = a;
1124 m_styleStore.SetUseDark(UseDarkMode());
1126 }
1128 void UpdateBackgroundBrush();
1130 bool UseDarkMode() const {
1131 if (m_appearance == Appearance::dark) return true;
1132 if (m_appearance == Appearance::light) return false;
1133 return SystemIsDark();
1134 }
1136 static bool SystemIsDark();
1137
1138 long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
1139 void RecentItems(long items){ m_recentItems = items; }
1140
1143 { return (m_showLabelChoice < labels_useronly); }
1144
1146 bool UseUserLabels() const
1147 { return m_showLabelChoice > labels_automatic; }
1148
1150 bool ShowLabels() const
1151 { return m_showLabelChoice < labels_none; }
1152
1154 void SetLabelChoice(showLabels choice) {
1155 if(m_showLabelChoice != choice)
1157 m_showLabelChoice = choice;
1158 }
1159
1160 bool PrintBrackets(bool print)
1161 {
1162 m_printBrackets = print;
1163 return print;
1164 }
1165
1167 bool AutodetectMaxima() const {return m_autodetectMaxima;}
1169 void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
1170
1172 wxString MaximaParameters() const {return m_maximaParameters;}
1174 void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
1175
1177 static wxString MaximaDefaultLocation();
1178
1180 wxString MaximaLocation() const;
1181
1183 wxString MaximaUserLocation() const {return m_maximaUserLocation;}
1184
1186 void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
1187
1189 bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
1191 void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
1192
1194 bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
1196 void InternalHelpBrowser(bool useInternalHelpBrowser)
1197 {m_useInternalHelpBrowser = useInternalHelpBrowser;}
1198
1200 bool SinglePageManual() const {return m_singlePageManual;}
1202 void SinglePageManual(bool singlePageManual)
1203 {m_singlePageManual = singlePageManual;}
1204
1206 wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
1207
1209 void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
1210
1217 static wxString FindProgram(const wxString &location);
1218
1221 { return m_fixReorderedIndices; }
1222
1223 void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
1224
1226 wxString MathJaXURL() const {
1227 if(m_mathJaxURL_UseUser)
1228 return m_mathJaxURL;
1229 else
1230 return MathJaXURL_Auto();}
1231 wxString MathJaXURL_User() const { return m_mathJaxURL;}
1232 bool MathJaXURL_UseUser() const { return m_mathJaxURL_UseUser;}
1233 void MathJaXURL_UseUser(bool useUser){m_mathJaxURL_UseUser = useUser;}
1234
1235 bool EnterEvaluates() const {return m_enterEvaluates;}
1236 void EnterEvaluates(bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
1237 static wxString MathJaXURL_Auto() { return wxS("https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js");}
1239 void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
1240
1241 bool HideMarkerForThisMessage(wxString message);
1242 void HideMarkerForThisMessage(const wxString &message, bool hide)
1243 {m_hideMarkerForThisMessage[message] = hide;}
1244 bool UseSVG() const {return m_useSVG;}
1245 void UseSVG(bool useSVG) { m_useSVG = useSVG ;}
1247 void ShowLength(long length) {
1248 m_showLength = length;
1249 }
1251 long ShowLength() const {return m_showLength;}
1253 std::size_t ShowLength_Bytes() const;
1254
1257 if(m_parenthesisDrawMode != mode)
1259 m_parenthesisDrawMode = mode;
1260 }
1261
1262 void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
1263
1264 bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
1265
1270 const Style *GetStyle(TextStyle textStyle) const { return &m_styleStore[textStyle]; }
1278 Style *GetWritableStyle(TextStyle textStyle) { return &m_styleStore[textStyle]; }
1279
1286 wxScrolledCanvas *GetWorkSheet() const {return m_workSheet;}
1288 void SetWorkSheet(wxScrolledCanvas *workSheet);
1289
1297 DocumentCellPointers *GetDocumentCellPointers() const {return m_documentCellPointers;}
1299 void SetDocumentCellPointers(DocumentCellPointers *p) {m_documentCellPointers = p;}
1301 ViewCellPointers *GetViewCellPointers() const {return m_viewCellPointers;}
1303 void SetViewCellPointers(ViewCellPointers *p) {m_viewCellPointers = p;}
1304
1312 {if (m_recalculateRequest) m_recalculateRequest(group);}
1314 void SetRecalculateRequestCallback(std::function<void(GroupCell *)> callback)
1315 {m_recalculateRequest = std::move(callback);}
1316
1326 {if (m_recalculateAllRequest) m_recalculateAllRequest();}
1328 void SetRecalculateAllRequestCallback(std::function<void()> callback)
1329 {m_recalculateAllRequest = std::move(callback);}
1330
1331 long DefaultPort() const {return m_defaultPort;}
1332 void DefaultPort(long port){m_defaultPort = port;}
1333 bool GetAbortOnError() const {return m_abortOnError;}
1334 void SetAbortOnError(bool abortOnError) {m_abortOnError = abortOnError;}
1335
1336 long GetLanguage() const {return m_language;}
1337 void SetLanguage(long language) {m_language = language;}
1338
1340 long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
1341 void MaxGnuplotMegabytes(long megaBytes)
1342 {m_maxGnuplotMegabytes = megaBytes;}
1343
1344 bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
1345 void OfferKnownAnswers(bool offerKnownAnswers)
1346 {m_offerKnownAnswers = offerKnownAnswers;}
1347
1354 bool ScreenReaderAnnouncesMathML() const {return m_screenReaderAnnouncesMathML;}
1356 {m_screenReaderAnnouncesMathML = mathML;}
1357
1358 wxString Documentclass() const {return m_documentclass;}
1359 void Documentclass(wxString clss){m_documentclass = std::move(clss);}
1360 wxString DocumentclassOptions() const {return m_documentclassOptions;}
1361 void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
1362
1363
1364 htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
1365 void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
1366 {m_htmlEquationFormat = HTMLequationFormat;}
1367
1368 AFontSize GetDefaultFontSize() const { return m_styleStore[TS_CODE_DEFAULT].GetFontSize(); }
1369 AFontSize GetMathFontSize() const { return m_styleStore[TS_MATH].GetFontSize(); }
1370
1372 long GetAutosubscript_Num() const {return m_autoSubscript;}
1373 void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
1374 wxString GetAutosubscript_string() const;
1376 wxColor DefaultBackgroundColor();
1378 wxColor EditorBackgroundColor();
1380 bool ClipToDrawRegion() const {return m_renderContext.ClipToDrawRegion();}
1382 void ClipToDrawRegion(bool clipToDrawRegion){m_renderContext.ClipToDrawRegion(clipToDrawRegion);}
1383 void SetVisibleRegion(wxRect visibleRegion){
1384 if(m_renderContext.GetVisibleRegion().GetWidth() != visibleRegion.GetWidth())
1386 m_renderContext.SetVisibleRegion(visibleRegion);
1387 }
1388 wxRect GetVisibleRegion() const {return m_renderContext.GetVisibleRegion();}
1389 void SetWorksheetPosition(wxPoint worksheetPosition){m_renderContext.SetWorksheetPosition(worksheetPosition);}
1390 wxPoint GetWorksheetPosition() const {return m_renderContext.GetWorksheetPosition();}
1391 wxString MaximaShareDir() const {return m_maximaSession.ShareDir();}
1392 void MaximaShareDir(wxString dir){m_maximaSession.ShareDir(std::move(dir));}
1393 wxString MaximaDemoDir() const {return m_maximaSession.DemoDir();}
1394 void MaximaDemoDir(wxString dir){m_maximaSession.DemoDir(std::move(dir));}
1395 void InLispMode(bool lisp){m_maximaSession.InLispMode(lisp);}
1396 bool InLispMode() const {return m_maximaSession.InLispMode();}
1397 void BitmapScale(int factor){m_bitmapScale = factor;}
1398 int BitmapScale() const {return m_bitmapScale;}
1399 void DefaultPlotHeight(int px){m_defaultPlotHeight = px;}
1400 int DefaultPlotHeight() const {return m_defaultPlotHeight;}
1401 void DefaultPlotWidth(int px){m_defaultPlotWidth = px;}
1402 int DefaultPlotWidth() const {return m_defaultPlotWidth;}
1403 void DefaultFramerate(double fps){m_defaultFramerate = fps;}
1404 double DefaultFramerate() const {return m_defaultFramerate;}
1405 void TocDepth(int depth){m_tocDepth = depth;}
1406 int TocDepth() const {return m_tocDepth;}
1407 bool TeXExponentsAfterSubscript() const {return m_TeXExponentsAfterSubscript;}
1408 void TeXExponentsAfterSubscript(bool ExponentsAfterSubscript)
1409 {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
1410 bool UsePartialForDiff() const {return m_usePartialForDiff;}
1411 void UsePartialForDiff(bool usePartialForDiff)
1412 {m_usePartialForDiff = usePartialForDiff;}
1420 {if (m_adjustWorksheetSizeRequest) m_adjustWorksheetSizeRequest();}
1422 void SetAdjustWorksheetSizeRequestCallback(std::function<void()> callback)
1423 {m_adjustWorksheetSizeRequest = std::move(callback);}
1425 void NotifyOfCellRedraw(const Cell *cell);
1435 void ReportMultipleRedraws();
1437 bool OfferInternalHelpBrowser() const;
1448 static bool ShowHelpInSidebarFromOldKey(bool stored, bool storedOnWindows,
1449 bool defaultValue);
1450 bool WrapLatexMath() const {return m_wrapLatexMath;}
1451 void WrapLatexMath(bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
1452 bool AllowNetworkHelp() const {return m_allowNetworkHelp;}
1453 void AllowNetworkHelp(bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
1454 bool ShowAllDigits() const {return m_showAllDigits;}
1455 void ShowAllDigits(bool shw){
1456 if(m_showAllDigits != shw)
1458 m_showAllDigits = shw;
1459 }
1460 bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
1461 void LineBreaksInLongNums(bool brk){
1462 if(m_lineBreaksInLongNums != brk)
1464 m_lineBreaksInLongNums = brk;
1465 }
1470 bool DigitGrouping() const {return m_digitGrouping;}
1471 void DigitGrouping(bool group){
1472 if(m_digitGrouping != group)
1474 m_digitGrouping = group;
1475 }
1477 long DigitGroupingMinDigits() const {return m_digitGroupingMinDigits;}
1478 void DigitGroupingMinDigits(long digits){
1479 digits = std::max(digits, DigitGroupingMinDigits_Min);
1480 if(m_digitGroupingMinDigits != digits)
1482 m_digitGroupingMinDigits = digits;
1483 }
1485 static constexpr long DigitGroupingMinDigits_Min = 2;
1486
1487 void ExportContainsWXMX(bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1488 bool ExportContainsWXMX() const {return m_exportContainsWXMX;}
1496 bool HTMLExportSelfContained() const {return m_htmlExportSelfContained;}
1497 void HTMLExportSelfContained(bool selfContained)
1498 {m_htmlExportSelfContained = selfContained;}
1499 void WizardTab(long tab){m_wizardTab = tab;}
1500 long WizardTab() const {return m_wizardTab;}
1501
1502 void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1503 bool Display2d_Unicode() const {return m_display2d_Unicode;}
1504
1505 #ifdef __WXMSW__
1506 bool UseWGnuplot() const {return m_useWgnuplot;}
1507 void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
1508 #endif
1509 wxString TexPreamble() const {return m_texPreamble;}
1510 void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1511
1512 void SetMaximaVersion(const wxString &version){m_maximaSession.SetMaximaVersion(version);}
1513 wxString GetMaximaVersion() const {return m_maximaSession.GetMaximaVersion();}
1514 void SetMaximaArch(const wxString &arch){m_maximaSession.SetMaximaArch(arch);}
1515 wxString GetMaximaArch() const {return m_maximaSession.GetMaximaArch();}
1516 void SetLispVersion(const wxString &version){m_maximaSession.SetLispVersion(version);}
1517 wxString GetLispVersion() const {return m_maximaSession.GetLispVersion();}
1518 void SetLispType(const wxString &type){m_maximaSession.SetLispType(type);}
1519 wxString GetLispType() const {return m_maximaSession.GetLispType();}
1520
1522 void InitStyles();
1524 bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT)
1525 { return m_fontRenderability.FontRendersChar(ch, font); }
1526
1528 const std::vector<TextStyle> &GetCodeStylesList() const {return m_styleStore.CodeStylesList();}
1530 const std::vector<TextStyle> &GetMathStylesList() const {return m_styleStore.MathStylesList();}
1532 const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_styleStore.ColorOnlyStylesList();}
1533 bool StyleAffectsCode(TextStyle style) const;
1534 bool StyleAffectsMathOut(TextStyle style) const;
1535 bool StyleAffectsColorOnly(TextStyle style) const;
1537 bool UpdateNeeded() const;
1539 static void SetDebugmode(){m_debugMode = true;}
1541 static bool GetDebugmode(){return m_debugMode;}
1551 bool MaximaHelpInConsole() const {return m_maximaHelpInConsole;}
1552 void MaximaHelpInConsole(bool console) {m_maximaHelpInConsole = console;}
1554 wxString MaximaHelpFormatName() const;
1560 wxString MaximaHelpFormatCommand() const;
1561
1562private:
1564 MaximaSessionInfo m_maximaSession;
1566 InitOpt m_initOpts;
1572 long m_configId;
1574 std::random_device m_rd;
1576 std::default_random_engine m_eng;
1577 wxEnvVariableHashMap m_maximaEnvVars;
1578public:
1580 std::random_device::result_type RandomEntropy(){return m_rd();}
1582 std::default_random_engine &RandomEngine(){return m_eng;}
1590 std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
1598 m_cellCfgCnt++;
1600 }
1601 static bool UseThreads(){return m_use_threads;}
1602 static void UseThreads(bool use){m_use_threads = use;}
1603 static void SetMaximaLang(const wxString &LANG){m_maxima_LANG = LANG;}
1604 static wxString GetMaximaLang(){return m_maxima_LANG;}
1605private:
1607 static wxString m_maxima_LANG;
1608 std::list<FileToSave> m_filesToSave;
1610 Styles m_styleStore;
1612 StringBoolHash m_hideMarkerForThisMessage;
1614 FontRenderabilityCache m_fontRenderability;
1615 mathDisplayMode m_displayMode = display_2d;
1616 static bool m_debugMode;
1617 bool m_showInputLabels;
1618 long m_wizardTab;
1619 bool m_display2d_Unicode;
1620 bool m_usePartialForDiff;
1622 bool m_autoSaveAsTempFile;
1624 long m_language;
1626 bool m_autodetectMaxima;
1628 bool m_autodetectHelpBrowser;
1630 bool m_useInternalHelpBrowser;
1632 bool m_singlePageManual;
1634 bool m_incrementalSearch;
1636 long m_autoSubscript;
1638 wxScrolledCanvas *m_workSheet = nullptr;
1640 DocumentCellPointers *m_documentCellPointers = nullptr;
1642 ViewCellPointers *m_viewCellPointers = nullptr;
1644 std::function<void(GroupCell *)> m_recalculateRequest;
1646 std::function<void()> m_recalculateAllRequest;
1648 std::function<void()> m_adjustWorksheetSizeRequest;
1650 RenderContext m_renderContext;
1651 bool m_wrapLatexMath;
1652 bool m_allowNetworkHelp;
1653 bool m_exportContainsWXMX;
1654 bool m_htmlExportSelfContained;
1655 wxString m_texPreamble;
1656
1657 drawMode m_parenthesisDrawMode;
1658 bool m_TeXExponentsAfterSubscript;
1659 wxString m_helpBrowserUserLocation;
1660 wxString m_maximaUserLocation;
1662 bool m_hideBrackets;
1664 bool m_overlayScrollbars;
1666 double m_printScale;
1667 double m_printMargin_Top;
1668 double m_printMargin_Bot;
1669 double m_printMargin_Left;
1670 double m_printMargin_Right;
1672 bool m_rightToLeftDocument;
1674 bool m_showBrackets;
1676 bool m_printBrackets;
1682 bool m_changeAsterisk;
1684 bool m_notifyIfIdle;
1686 bool m_findDialogDockable;
1688 bool m_mcpServerEnabled;
1690 int m_mcpServerPort;
1692 int m_aiChatProvider;
1693 wxString m_aiModelAnthropic;
1694 wxString m_aiModelOpenAI;
1695 wxString m_aiModelGoogle;
1696 wxString m_aiModelQwen;
1697 wxString m_aiModelGitHubModels;
1698 wxString m_aiModelDeepSeek;
1699 wxString m_aiModelOpenRouter;
1701 wxString m_aiCustomProvidersJson;
1703 wxString m_aiActiveCustomProviderId;
1705 long m_displayedDigits;
1707 long m_autoWrap;
1709 bool m_autoIndent;
1711 bool m_showAllDigits;
1713 bool m_lineBreaksInLongNums;
1715 bool m_digitGrouping;
1717 long m_digitGroupingMinDigits;
1719 bool m_matchParens;
1721 bool m_insertAns;
1723 bool m_openHCaret;
1725 long m_labelWidth;
1726 long m_indent;
1727 bool m_latin2greek;
1728 double m_zoomFactor;
1729 bool m_outdated;
1730 wxString m_maximaParameters;
1731 bool m_keepPercent;
1732 bool m_restartOnReEvaluation;
1733 wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1734 long m_lineWidth_em;
1735 showLabels m_showLabelChoice;
1736 bool m_fixReorderedIndices;
1737 wxString m_mathJaxURL;
1738 bool m_mathJaxURL_UseUser;
1739 bool m_showCodeCells;
1740 long m_showLength;
1741 bool m_usepngCairo;
1742 bool m_enterEvaluates;
1743 bool m_useSVG;
1744 bool m_fixedFontTC;
1745 bool m_TOCshowsSectionNumbers;
1746 bool m_indentMaths;
1747 bool m_abortOnError;
1748 bool m_showMatchingParens;
1749 bool m_hidemultiplicationsign;
1750 bool m_offerKnownAnswers;
1751 bool m_screenReaderAnnouncesMathML;
1752 long m_defaultPort;
1753 long m_maxGnuplotMegabytes;
1754 long m_defaultPlotHeight;
1755 long m_defaultPlotWidth;
1756 bool m_saveUntitled;
1757 bool m_cursorJump;
1758 bool m_arrowKeysSkipOutput;
1759 bool m_numpadEnterEvaluates;
1760 bool m_saveImgFileName;
1761 wxString m_documentclass;
1762 wxString m_documentclassOptions;
1763 htmlExportFormat m_htmlEquationFormat;
1764
1765 wxColour m_defaultBackgroundColor;
1766 bool m_greekSidebar_ShowLatinLookalikes;
1767 #ifdef __WXMSW__
1768 bool m_useWgnuplot = false;
1769 #endif
1770 bool m_greekSidebar_Show_mu;
1771 wxString m_symbolPaneAdditionalChars;
1772 Appearance m_appearance = Appearance::followSystem;
1773 long m_recentItems;
1774 int m_bitmapScale;
1775 double m_defaultFramerate;
1776 int m_tocDepth;
1777 int m_autoSaveMinutes;
1778 int m_maxLayoutTime;
1779 LayoutStrategy m_layoutStrategy = LayoutStrategy::layout2DIfFits;
1780 OversizedMatrices m_oversizedMatrices = OversizedMatrices::elide;
1782 bool m_oversizedMatricesOverridable = true;
1785 MatrixScrollHost *m_matrixScrollHost = nullptr;
1787 int m_worksheetTopOffset = 0;
1788 wxString m_wxMathML_Filename;
1789 bool m_maximaHelpInConsole = false;
1790 std::atomic<std::int_fast32_t> m_cellCfgCnt{0};
1791 static bool m_use_threads;
1792};
1793
1796{
1797public:
1798 explicit Printing(Configuration *configuration)
1799 {
1800 m_configuration = configuration;
1801 m_configuration->SetPrinting(true);
1802 }
1803 virtual ~Printing()
1804 {
1805 m_configuration->SetPrinting(false);
1806 }
1807private:
1808 Configuration * m_configuration;
1809};
1810
1813{
1814public:
1815 explicit NoClipToDrawRegion(Configuration *configuration)
1816 {
1817 m_configuration = configuration;
1818 m_configuration->ClipToDrawRegion(false);
1819 }
1820 virtual ~NoClipToDrawRegion()
1821 {
1822 m_configuration->ClipToDrawRegion(true);
1823 }
1824private:
1825 Configuration * m_configuration;
1826};
1827
1828#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
int group
Neighbouring sections of the same group aren't separated.
Definition: ToolBarSections.cpp:45
const wxChar * key
The name in the config file.
Definition: ToolBarSections.cpp:37
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:985
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:1001
The configuration storage for the current worksheet.
Definition: Configuration.h:101
void SetOversizedMatrices(OversizedMatrices mode, bool perMatrixOverridable=true)
Sets how oversized matrices are shown.
Definition: Configuration.h:540
void RecalculateForce()
Force every cell to be recalculated on the next layout pass.
Definition: Configuration.h:1597
bool HTMLExportSelfContained() const
Does the HTML export produce one self-contained file?
Definition: Configuration.h:1496
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:373
wxString AiActiveCustomProviderId() const
Which custom provider is active, by AiCustomProviderConfig::id – meaningful only when AiChatProvider(...
Definition: Configuration.h:965
Appearance
How wxMaxima chooses between the light and the dark style set.
Definition: Configuration.h:1119
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:1206
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:1013
long GetAsciiArtColumns() const
How many columns of the ASCII-art monospace font (TS_ASCIIMATHS) fit into GetLineWidth()?...
Definition: Configuration.cpp:1073
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:1372
void SetViewCellPointers(ViewCellPointers *p)
Register the transient view-state half of the cell-pointer registry.
Definition: Configuration.h:1303
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:1142
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:1191
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.h:1524
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:1239
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:301
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1541
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:841
std::list< FileToSave > TakeFilesToSave()
Hands out the list of files to save, leaving it empty.
Definition: Configuration.h:1030
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:355
static bool SystemIsDark()
Whether the OS reports a dark appearance (false where wx cannot tell).
Definition: Configuration.cpp:517
static bool ShowHelpInSidebarFromOldKey(bool stored, bool storedOnWindows, bool defaultValue)
What the "useInternalHelpBrowser" key of an old config means now.
Definition: Configuration.cpp:1324
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:703
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:224
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:685
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:1023
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1029
static wxString FindProgram(const wxString &location)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:584
wxString AiModelAnthropic() const
The model id to request from each provider; defaults to AiProviderDefaultModel() but the user can ove...
Definition: Configuration.h:939
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:1383
bool DrawImageBackdrop()
Whether images are to be drawn on the TS_IMAGE_BACKDROP colour right now.
Definition: Configuration.h:583
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:622
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:292
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.cpp:564
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:521
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:316
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:878
OversizedMatrices OversizedMatricesFor(std::optional< OversizedMatrices > requested) const
How one specific matrix that is too large for the window is shown.
Definition: Configuration.h:557
void RequestRecalculateAll() const
Ask the view to schedule a recalculation of the WHOLE worksheet.
Definition: Configuration.h:1325
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:529
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1041
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1163
bool McpServerEnabled() const
Run the MCP (Model Context Protocol) server, exposing the current worksheet's contents (cells,...
Definition: Configuration.h:895
static constexpr long DigitGroupingMinDigits_Min
The smallest value DigitGroupingMinDigits() accepts: 1 digit has no groups.
Definition: Configuration.h:1485
int McpServerPort() const
Which localhost TCP port the MCP server listens on, if enabled.
Definition: Configuration.h:899
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:1154
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:1315
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:784
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:1200
void ClearMaximaEnvVars()
Forget all custom environment variables for the maxima process.
Definition: Configuration.h:195
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1498
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1530
DocumentCellPointers * GetDocumentCellPointers() const
The registry of special cells (selection, active cell, errors, ...) of this document.
Definition: Configuration.h:1297
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:1009
bool UseDarkMode() const
Whether the dark style set is currently active.
Definition: Configuration.h:1130
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:1183
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:1278
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:401
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1195
wxString MaximaHelpFormatCommand() const
The command that sets Maxima's output_format_for_help accordingly.
Definition: Configuration.cpp:930
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:200
long DigitGroupingMinDigits() const
How many digits a number needs before DigitGrouping() groups them.
Definition: Configuration.h:1477
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:416
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1590
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:1150
bool FindDialogDockable() const
Show "Find and Replace" as a dockable sidebar instead of a floating dialog?
Definition: Configuration.h:884
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:1172
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:1055
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:1196
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:369
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:637
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:1202
ImageBackdrop
What is drawn behind the transparent parts of an image (GH #2227)
Definition: Configuration.h:569
@ none
Nothing: the worksheet shows through.
@ always
Always the backdrop colour.
@ onDarkBackground
The backdrop colour, but only if the worksheet's background is dark (the default)
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:718
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1156
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:560
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:1491
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:246
MatrixScrollHost * GetMatrixScrollHost() const
What gives a scrolling matrix its scrollbars, if anything.
Definition: Configuration.h:601
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:712
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:405
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:237
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:336
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:209
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:467
void SetRecalculateAllRequestCallback(std::function< void()> callback)
Set the callback RequestRecalculateAll() / RecalculateForce() notify through.
Definition: Configuration.h:1328
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:202
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:1340
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:476
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:1209
void SetWorksheetTopOffset(int offset)
Sets the extra top margin.
Definition: Configuration.h:464
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:205
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:780
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1528
static const wxString CharsNeedingQuotes()
Returns a list of chars we need to escape in maxima.
Definition: Configuration.h:386
void SetAppearance(Appearance a)
Choose the appearance and update which style set is active.
Definition: Configuration.h:1122
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:1226
bool RightToLeftDocument() const
Does the document read right-to-left (Arabic, Hebrew, Persian, Urdu)?
Definition: Configuration.h:1083
void UpdateBackgroundBrush()
Refresh the cached document-background brush from the active style set.
Definition: Configuration.cpp:555
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:1169
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:844
std::random_device::result_type RandomEntropy()
One sample of OS entropy (std::random_device).
Definition: Configuration.h:1580
bool MaximaHelpInConsole() const
Does Maxima answer ?, ?? and describe() with plain text in the worksheet?
Definition: Configuration.h:1551
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:340
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:510
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1539
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:288
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:1167
wxScrolledCanvas * GetWorkSheet() const
Get the worksheet canvas this configuration storage is valid for.
Definition: Configuration.h:1286
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:1380
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1110
bool DigitGrouping() const
Separate the digit groups of long numbers by a small gap? (GH #192)
Definition: Configuration.h:1470
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:1094
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:1220
void AddMaximaOperator(const wxString &name)
Register name as an operator known to maxima.
Definition: Configuration.h:192
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:825
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:250
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:488
bool GetAutoWrapCode() const
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:689
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1050
void SetFilesToSave(std::list< FileToSave > files)
Replaces the list of files to save; see TakeFilesToSave().
Definition: Configuration.h:1032
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:248
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:532
void RequestAdjustWorksheetSize() const
Ask the view (if any) to re-adjust its worksheet (scroll) size.
Definition: Configuration.h:1419
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:310
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:1186
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1331
bool OverlayScrollbars() const
Use GTK's overlay scrollbars on the worksheet?
Definition: Configuration.h:329
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:1382
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1296
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:434
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:275
static wxColour TooltipMarkerColour(const wxColour &background)
The color the background of a cell with a mouse-over tooltip is tinted to.
Definition: Configuration.cpp:569
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:649
void MakeTemporary()
Makes this configuration temporary.
Definition: Configuration.h:231
std::default_random_engine & RandomEngine()
The pseudo-random engine, e.g. to feed a distribution.
Definition: Configuration.h:1582
wxString MaximaHelpFormatName() const
The value of Maxima's output_format_for_help MaximaHelpInConsole() stands for.
Definition: Configuration.cpp:924
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:320
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:628
ViewCellPointers * GetViewCellPointers() const
The transient view-state half of the cell-pointer registry (null if none).
Definition: Configuration.h:1301
int GetWorksheetTopOffset() const
An extra top margin of less than one scroll unit, in px.
Definition: Configuration.h:458
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1303
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:631
void SetRecalculateRequestCallback(std::function< void(GroupCell *)> callback)
Set the callback RequestRecalculate() notifies the view through.
Definition: Configuration.h:1314
InitOpt
Definition: Configuration.h:175
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:177
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:1194
bool ScreenReaderAnnouncesMathML() const
Announce maxima's output to screen readers as MathML?
Definition: Configuration.h:1354
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:1256
drawMode
Definition: Configuration.h:169
@ ascii
Use ascii characters only.
Definition: Configuration.h:170
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:171
void OverlayScrollbars(bool overlay)
Define if the worksheet should use GTK's overlay scrollbars.
Definition: Configuration.h:333
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:1059
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:1174
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:1017
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:1251
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:244
OversizedMatrices
How to show a matrix too large for the window.
Definition: Configuration.h:517
@ 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:906
void SetMaximaEnvVar(const wxString &name, const wxString &value)
Set a custom environment variable for the maxima process.
Definition: Configuration.h:197
wxString AiCustomProvidersJson() const
User-added custom providers (beyond the four built-in ones), as a JSON array – see AiCustomProviderCo...
Definition: Configuration.h:959
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1167
void SetMatrixScrollHost(MatrixScrollHost *host)
Sets the scrollbar host.
Definition: Configuration.h:609
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:143
@ mathML_mathJaX
Native MathML, plus MathJaX downloaded as a fall-back only for the few browsers that still lack MathM...
Definition: Configuration.h:151
@ mathJaX_TeX
Deprecated: the TeX-via-MathJaX HTML export was removed. The value is kept so saved configurations mi...
Definition: Configuration.h:147
@ mathML
Native MathML with no MathJaX at all: the exported page makes no external requests....
Definition: Configuration.h:155
void SetAdjustWorksheetSizeRequestCallback(std::function< void()> callback)
Set the callback RequestAdjustWorksheetSize() notifies the view through.
Definition: Configuration.h:1422
void SetDocumentCellPointers(DocumentCellPointers *p)
Register the document-model half of the cell-pointer registry.
Definition: Configuration.h:1299
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:1146
bool ArrowKeysSkipOutput() const
Do the Up and Down keys skip over a cell's output?
Definition: Configuration.h:675
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1343
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1516
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:972
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:1270
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:1189
void SetWorkSheet(wxScrolledCanvas *workSheet)
Set the worksheet canvas this configuration storage is valid for.
Definition: Configuration.cpp:215
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:190
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:1247
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:408
void RequestRecalculate(GroupCell *group) const
Ask the view (if any) to recalculate the layout starting at the given group cell.
Definition: Configuration.h:1311
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1532
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:1105
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:1813
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1796
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:108
const std::vector< TextStyle > & MathStylesList() const
The styles that share the 2d-math font.
Definition: Styles.h:106
const std::vector< TextStyle > & CodeStylesList() const
The styles that share the code-default font/attributes.
Definition: Styles.h:104
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:103
std::atomic< long > worksheetRepaints
How often the worksheet was repainted (Worksheet::OnPaint ran)
Definition: Configuration.h:128
std::atomic< long > cellsDrawnAtWrongFontSize
How many cells were drawn at a different font size than they were laid out with.
Definition: Configuration.h:126
std::atomic< long > worksheetFullRepaints
How many of those repaints covered (nearly) the whole visible worksheet.
Definition: Configuration.h:136
One mechanically persisted scalar setting: its config key and the member variable it is stored in.
Definition: Configuration.h:755
const wxChar * key
The key the setting is stored under in the configuration store.
Definition: Configuration.h:757
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:762