wxMaxima
Configuration.h
1 // -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2 //
3 // Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // SPDX-License-Identifier: GPL-2.0+
21 
22 #ifndef CONFIGURATION_H
23 #define CONFIGURATION_H
24 
25 #include "precomp.h"
26 #include <wx/wx.h>
27 #include <wx/config.h>
28 #include <wx/display.h>
29 #include <wx/fontenum.h>
30 #include <wx/hashmap.h>
32 #include "cells/TextStyle.h"
33 #include <cstdint>
34 #include <memory>
35 #include <mutex>
36 #include <unordered_map>
37 #include <random>
38 #include <list>
39 #include <vector>
40 #include <algorithm>
41 #include <wx/wupdlock.h>
42 #include <wx/webview.h>
43 #ifdef __WXMSW__
44 #include <wx/msw/webview_ie.h>
45 #endif
46 
47 #define MC_LINE_SKIP Scale_Px(2)
48 #define MC_TEXT_PADDING Scale_Px(1)
49 
50 #define PAREN_OPEN_TOP_UNICODE "\u239b"
51 #define PAREN_OPEN_EXTEND_UNICODE "\u239c"
52 #define PAREN_OPEN_BOTTOM_UNICODE "\u239d"
53 #define PAREN_CLOSE_TOP_UNICODE "\u239e"
54 #define PAREN_CLOSE_EXTEND_UNICODE "\u239f"
55 #define PAREN_CLOSE_BOTTOM_UNICODE "\u23a0"
56 #define SUM_SIGN "\u2211"
57 #define PROD_SIGN "\u220F"
59 #define SUM_DEC 2
60 
62 #define MC_HCARET_WIDTH 25
63 
64 #define MC_EXP_INDENT static_cast<wxCoord>(Scale_Px(2))
65 static constexpr AFontSize MC_MIN_SIZE{ 6.0f };
66 static constexpr AFontSize MC_MAX_SIZE{ 48.0f };
67 
68 #define LIBERTINE1 "LinLibertine_DRah.ttf"
69 #define LIBERTINE2 "LinLibertine_I.ttf"
70 #define LIBERTINE3 "LinLibertine_Mah.ttf"
71 #define LIBERTINE4 "LinLibertine_Rah.ttf"
72 #define LIBERTINE5 "LinLibertine_RBah.ttf"
73 #define LIBERTINE6 "LinLibertine_RBIah.ttf"
74 #define LIBERTINE7 "LinLibertine_RIah.ttf"
75 #define LIBERTINE8 "LinLibertine_RZah.ttf"
76 #define LIBERTINE9 "LinLibertine_RZIah.ttf"
77 
78 class Cell;
79 
95 {
96 public:
97  enum maximaHelpFormat{
98  maxima = 0,
99  frontend = 1,
100  browser = 2
101  };
104  {
105  mathJaX_TeX = 0,
106  bitmap = 1,
107  mathML_mathJaX = 2,
108  svg = 3,
109  html_export_invalidChoice
110  };
111 
112  enum showLabels : int8_t
113  {
114  labels_automatic = 0,
115  labels_prefer_user = 1,
116  labels_useronly = 2,
117  labels_none = 3,
118  labels_invalidSelection
119  };
120 
121  enum drawMode
122  {
124  handdrawn
125  };
126 
127  enum InitOpt
128  {
129  none,
130  temporary
131  };
132 
133  enum mathDisplayMode
134  {
135  display_2d,
136  display_2dASCII,
137  display_2dUNICODE,
138  display_1dASCII
139  };
140 
141  typedef std::unordered_map <wxString, bool, wxStringHash> StringBoolHash;
142  typedef std::unordered_map <wxString, wxString, wxStringHash> RenderablecharsHash;
143  typedef std::unordered_map <wxString, int, wxStringHash> StringHash;
146  StringHash m_maximaOperators;
148  bool IsOperator(wxString name){return !(m_maximaOperators.find(name) == m_maximaOperators.end());}
149  const wxEnvVariableHashMap& MaximaEnvVars() const {return m_maximaEnvVars;}
150  wxEnvVariableHashMap m_maximaEnvVars;
151 
153  mathDisplayMode DisplayMode() const {return m_displayMode;}
155  void DisplayMode(mathDisplayMode mode ) {m_displayMode = mode;}
156 
158  void SetWorkingDirectory(wxString dir)
159  { m_workingdir = std::move(dir); }
160 
162  wxString GetWorkingDirectory() const
163  { return m_workingdir; }
164 
166  void ReadConfig();
167 
172  explicit Configuration(wxDC *dc = {}, InitOpt options = none);
173 
175  void ResetAllToDefaults();
176 
178  void SetRecalcContext(wxDC &dc)
179  {
180  m_dc = &dc;
181  }
182  void UnsetContext() {m_dc = NULL;}
183 
185  void SetBackgroundBrush(const wxBrush &brush);
187  bool FixedFontInTextControls() const {return m_fixedFontTC;}
189  void FixedFontInTextControls(bool fixed) {m_fixedFontTC = fixed;}
191  wxBrush GetBackgroundBrush() const {return m_BackgroundBrush;}
193  wxBrush GetTooltipBrush() const {return m_tooltipBrush;}
194 
195  virtual ~Configuration();
196 
202 
204  static std::unordered_map<TextStyle, wxString> m_styleNames;
205  using EscCodeContainer = std::unordered_map<wxString, wxString, wxStringHash>;
206  using EscCodeIterator = EscCodeContainer::const_iterator;
207 
209  static const wxString &GetEscCode(const wxString &key);
211  static EscCodeIterator EscCodesBegin();
213  static EscCodeIterator EscCodesEnd();
214 
216  static double GetMinZoomFactor()
217  { return 0.1; }
218 
220  static double GetMaxZoomFactor()
221  { return 32.0; }
222 
229  double GetInterEquationSkip() const
230  {
231  if (ShowAutomaticLabels())
232  return 0;
233  else
234  return GetZoomFactor() * m_styles[TS_MATH].GetFontSize() / 2;
235  }
236 
238  wxCoord GetCellBracketWidth() const
239  {
240  return static_cast<wxCoord>(GetZoomFactor() * 16);
241  }
242 
244  bool HideBrackets() const
245  { return m_hideBrackets; }
246 
248  void HideBrackets(bool hide){m_hideBrackets = hide;}
249 
251  double PrintScale() const
252  { return m_printScale; }
253 
255  void PrintScale(double scale){m_printScale = scale;}
256 
257  void PrintMargin_Top(double margin){m_printMargin_Top = margin;}
258  void PrintMargin_Bot(double margin){m_printMargin_Bot = margin;}
259  void PrintMargin_Left(double margin){m_printMargin_Left = margin;}
260  void PrintMargin_Right(double margin){m_printMargin_Right = margin;}
261  double PrintMargin_Top() const {return m_printMargin_Top;}
262  double PrintMargin_Bot() const {return m_printMargin_Bot;}
263  double PrintMargin_Left() const {return m_printMargin_Left;}
264  double PrintMargin_Right() const {return m_printMargin_Right;}
265 
267  void SetZoomFactor(double newzoom);
268 
270  void SetZoomFactor_temporarily(double newzoom){
271  if(m_zoomFactor != newzoom)
272  RecalculateForce();
273  m_zoomFactor = newzoom; ;
274  }
275 
280  wxCoord Scale_Px(double px) const;
281  AFontSize Scale_Px(AFontSize size) const;
282 
284  double GetZoomFactor() const
285  { return m_zoomFactor; }
286 
288  wxDC *GetRecalcDC() const
289  { return m_dc; }
290 
291  void SetRecalcDC(wxDC *dc)
292  { m_dc = dc; }
293 
294  wxString GetFontName(TextStyle ts = TS_CODE_DEFAULT) const;
295 
296  // cppcheck-suppress functionStatic
297  // cppcheck-suppress functionConst
298  wxString GetSymbolFontName() const;
299 
300  wxFontWeight IsBold(long st) const;
301 
302  wxFontStyle IsItalic(long st) const;
303 
304  bool IsUnderlined(long st) const {return m_styles[st].IsUnderlined();}
305 
310  wxCoord GetLabelWidth() const
311  { return m_labelWidth * 14; }
312 
314  long LabelWidth() const
315  { return m_labelWidth; }
317  void LabelWidth(long labelWidth)
318  {
319  if(m_labelWidth != labelWidth)
320  RecalculateForce();
321  m_labelWidth = labelWidth;
322  }
323 
325  wxCoord GetIndent() const
326  {
327  if (m_indent < 0)
328  return 3 * GetCellBracketWidth() / 2;
329  else
330  return m_indent;
331  }
332 
338  wxSize GetPPI() const;
339  int AutosaveMinutes() const {return m_autoSaveMinutes;}
340  void AutosaveMinutes(int minutes){m_autoSaveMinutes = minutes;}
341 
343  long GetCursorWidth() const
344  {
345  long ppi;
346 
347  if(!m_printing)
348  ppi = GetPPI().x;
349  else
350  ppi = 96;
351 
352  if (ppi / 45 < 1)
353  return 1;
354  else
355  return ppi / 45;
356  }
357 
359  long GetBaseIndent() const
360  {
361  if (GetCursorWidth() < 12)
362  return 12;
363  else
364  return 4 + GetCursorWidth();
365  }
366 
368  long GetGroupSkip() const
369  {
370  if (GetCursorWidth() < 10)
371  return 20;
372  else
373  return 10 + GetCursorWidth();
374  }
375 
380  void SetIndent(long indent)
381  {
382  if(m_indent != indent)
383  RecalculateForce();
384  m_indent = indent;
385  }
386 
387  bool IncrementalSearch() const {return m_incrementalSearch;}
388 
389 
390  void IncrementalSearch(bool incrementalSearch) { m_incrementalSearch = incrementalSearch; }
391 
392  struct CharsExist {
393  wxString chars;
394  bool exist;
395  CharsExist(const wxString &chars, bool exist) : chars(chars), exist(exist) {}
396  };
397  std::vector<CharsExist> m_charsInFont;
398 
400  void FontChanged()
401  {
402  m_charsInFont.clear();
403  RecalculateForce();
404  }
405 
407  double GetDefaultLineWidth() const
408  {
409  if (GetZoomFactor() < 1.0)
410  return 1.0;
411  else
412  return GetZoomFactor();
413  }
414 
416  long LineWidth_em() const
417  {
418  if(!m_printing)
419  return m_lineWidth_em;
420  else
421  return 10000;
422  }
423 
424  bool AutoSaveAsTempFile() const {return m_autoSaveAsTempFile;}
425  void AutoSaveAsTempFile(bool asTempFile){m_autoSaveAsTempFile = asTempFile;}
426 
428  void LineWidth_em(long width)
429  { m_lineWidth_em = width; }
430 
432  // On big 16:9 screens text tends to get \b very wide before it hits the right margin.
433  // But text blocks that are 1 meter wide and 2 cm high feel - weird.
434  long GetLineWidth() const;
435 
436  bool SaveUntitled() const { return m_saveUntitled;}
437  void SaveUntitled(bool save) {m_saveUntitled = save;}
438 
439  bool CursorJump() const { return m_cursorJump;}
440  void CursorJump(bool save){m_cursorJump = save;}
441 
442  bool NumpadEnterEvaluates() const { return m_numpadEnterEvaluates;}
443  void NumpadEnterEvaluates(bool eval){m_numpadEnterEvaluates = eval;}
444 
445  bool SaveImgFileName() const { return m_saveImgFileName;}
446  void SaveImgFileName(bool save) { m_saveImgFileName = save;}
447 
449  bool GetAutoWrap() const
450  { return m_autoWrap > 0; }
451 
452  // cppcheck-suppress functionStatic
454  static bool GetAutoWrapCode()
455  { return false; }
456 
463  void SetAutoWrap(long autoWrap){m_autoWrap = autoWrap;}
464 
466  bool GetAutoIndent() const
467  { return m_autoIndent; }
468 
469  void SetAutoIndent(bool autoIndent){m_autoIndent = autoIndent;}
470 
472  bool IndentMaths() const {return m_indentMaths;}
473  void IndentMaths(bool indent){
474  if(m_indentMaths != indent)
475  RecalculateForce();
476  m_indentMaths = indent;}
477  AFontSize GetFontSize(TextStyle st) const { return m_styles[st].GetFontSize(); }
478 
479  static const wxString &GetStyleName(TextStyle textStyle);
480 
486  void ReadStyles(const wxString &file = {});
487 
492  void WriteStyles(const wxString &file = {});
493  void WriteStyles(wxConfigBase *config);
494  void WriteSettings(const wxString &file = {});
495  void MakeStylesConsistent();
496  void Outdated(bool outdated)
497  { m_outdated = outdated; }
498 
500  bool CheckKeepPercent() const
501  { return m_keepPercent; }
502 
504  void SetKeepPercent(bool keepPercent)
505  {
506  if(m_keepPercent != keepPercent)
507  RecalculateForce();
508  m_keepPercent = keepPercent;
509  }
510 
511  wxString GetTeXCMRI() const
512  { return m_fontCMRI; }
513 
514  wxString GetTeXCMSY() const
515  { return m_fontCMSY; }
516 
517  wxString GetTeXCMEX() const
518  { return m_fontCMEX; }
519 
520  wxString GetTeXCMMI() const
521  { return m_fontCMMI; }
522 
523  wxString GetTeXCMTI() const
524  { return m_fontCMTI; }
525 
526  bool ShowCodeCells() const
527  { return m_showCodeCells; }
528 
529  void ShowCodeCells(bool show);
530 
537  void SetPrinting(bool printing);
538 
545  bool GetPrinting() const
546  { return m_printing; }
547 
549  wxColour GetColor(TextStyle style);
550 
552  static wxColour InvertColour(wxColour col);
553 
558  wxColor MakeColorDifferFromBackground(wxColor color);
559 
560  bool UsePngCairo() const { return m_usepngCairo;}
561  void UsePngCairo(bool usepngCairo) { m_usepngCairo = usepngCairo;}
562 
563  bool GetMatchParens() const { return m_matchParens; }
564  void SetMatchParens(bool matchParens) { m_matchParens = matchParens; }
565  bool ShowMatchingParens() const { return m_showMatchingParens; }
566  void ShowMatchingParens(bool show) { m_showMatchingParens = show; }
567 
569  bool GetChangeAsterisk() const{ return m_changeAsterisk; }
570 
572  void SetChangeAsterisk(bool changeAsterisk) {
573  if(m_changeAsterisk != changeAsterisk)
574  RecalculateForce();
575  m_changeAsterisk = changeAsterisk;
576  }
577 
578  bool HidemultiplicationSign() const {return m_hidemultiplicationsign;}
579 
580  void HidemultiplicationSign(bool show) {
581  if(m_hidemultiplicationsign != show)
582  RecalculateForce();
583  m_hidemultiplicationsign = show;
584  }
585 
586  bool Latin2Greek() const
587  {return m_latin2greek;}
588 
589  void Latin2Greek(bool latin2greek) {
590  if(m_latin2greek != latin2greek)
591  RecalculateForce();
592  m_latin2greek = latin2greek;
593  }
594 
595  bool GreekSidebar_ShowLatinLookalikes() const {return m_greekSidebar_ShowLatinLookalikes;}
596  void GreekSidebar_ShowLatinLookalikes(bool show){m_greekSidebar_ShowLatinLookalikes = show;}
597 
598  bool GreekSidebar_Show_mu() const {return m_greekSidebar_Show_mu;}
599  void GreekSidebar_Show_mu(bool show) {m_greekSidebar_Show_mu = show;}
600 
601  wxString SymbolPaneAdditionalChars() const
602  {return m_symbolPaneAdditionalChars;}
603  void SymbolPaneAdditionalChars(wxString symbols) {m_symbolPaneAdditionalChars = std::move(symbols);}
604 
606  bool NotifyIfIdle() const
607  { return m_notifyIfIdle; }
608 
609  void NotifyIfIdle(bool notify) {m_notifyIfIdle = notify;}
610 
615  long GetDisplayedDigits() const
616  { return m_displayedDigits; }
617 
618  void SetDisplayedDigits(long displayedDigits)
619  {
620  wxASSERT_MSG(displayedDigits >= 0, _("Bug: Maximum number of digits that is to be displayed is too low!"));
621  if(m_displayedDigits != displayedDigits)
622  RecalculateForce();
623  m_displayedDigits = displayedDigits;
624  }
625 
628  {
629  public:
630  FileToSave(const wxString &filename, const wxMemoryBuffer &data):
631  m_data(data),
632  m_filename(filename)
633  {
634  }
635  const wxString FileName() const{return m_filename;}
636  const wxMemoryBuffer Data() const{return m_data;}
637  private:
638  const wxMemoryBuffer m_data;
639  const wxString m_filename;
640  };
641 
644  {
645  public:
646  TextsnippetToDraw(const wxPoint &pos, const wxString &text, const wxColor &color):
647  m_pos(pos),
648  m_text(text),
649  m_color(color)
650  {
651  }
652  const wxPoint Pos() const{return m_pos;}
653  const wxString Text() const{return m_text;}
654  const wxColor Color() const{return m_color;}
655  private:
656  const wxPoint m_pos;
657  const wxString m_text;
658  const wxColor m_color;
659  };
660 
661  FileToSave PopFileToSave();
662  void PushFileToSave(const wxString &filename, const wxMemoryBuffer &data)
663  { m_filesToSave.emplace_front(FileToSave(filename, data)); }
664 
665  wxRect GetUpdateRegion() const {return m_updateRegion;}
666  const std::list<FileToSave> &GetFilesToSave() const {return m_filesToSave;}
667  void ClearFilesToSave () { m_filesToSave.clear();}
668  void SetUpdateRegion(wxRect rect){m_updateRegion = rect;}
669 
672  bool InUpdateRegion(wxRect rect) const;
673 
674  bool GetInsertAns() const
675  { return m_insertAns; }
676 
677  void SetInsertAns(bool insertAns){ m_insertAns = insertAns; }
678 
679  bool GetOpenHCaret() const
680  { return m_openHCaret; }
681 
682  void SetOpenHCaret(bool openHCaret){ m_openHCaret = openHCaret; }
683 
684  bool RestartOnReEvaluation() const
685  { return m_restartOnReEvaluation; }
686 
687  void RestartOnReEvaluation(bool arg){ m_restartOnReEvaluation = arg; }
688 
690  wxSize GetCanvasSize() const
691  { return m_canvasSize; }
692 
694  void SetCanvasSize(wxSize siz)
695  {
696  if(m_canvasSize.GetWidth() != siz.GetWidth())
697  RecalculateForce();
698  m_canvasSize = siz;
699  }
700 
702  bool ShowBrackets() const
703  { return m_showBrackets; }
704 
705  bool ShowBrackets(bool show)
706  {
707  if(m_showBrackets != show)
708  RecalculateForce();
709  return m_showBrackets = show;
710  }
711 
713  bool PrintBrackets() const
714  { return m_printBrackets; }
715 
716  showLabels GetLabelChoice() const
717  { return m_showLabelChoice; }
718 
719  bool ShowInputLabels() const {return m_showInputLabels;}
720  void ShowInputLabels(bool show) {
721  if(m_showInputLabels != show)
722  RecalculateForce();
723  m_showInputLabels = show;
724  }
725 
726  bool InvertBackground() const {return m_invertBackground;}
727  void InvertBackground(bool invert){ m_invertBackground = invert; }
728 
729  long UndoLimit(){return std::max(m_undoLimit, static_cast<long>(0));}
730  void UndoLimit(long limit){ m_undoLimit = limit; }
731 
732  long RecentItems(){return std::max(m_recentItems, static_cast<long>(0));}
733  void RecentItems(long items){ m_recentItems = items; }
734 
736  bool ShowAutomaticLabels() const
737  { return (m_showLabelChoice < labels_useronly); }
738 
740  bool UseUserLabels() const
741  { return m_showLabelChoice > labels_automatic; }
742 
744  bool ShowLabels() const
745  { return m_showLabelChoice < labels_none; }
746 
748  void SetLabelChoice(showLabels choice) {
749  if(m_showLabelChoice != choice)
750  RecalculateForce();
751  m_showLabelChoice = choice;
752  }
753 
754  bool PrintBrackets(bool print)
755  {
756  m_printBrackets = print;
757  return print;
758  }
759 
761  bool AutodetectMaxima() const {return m_autodetectMaxima;}
763  void AutodetectMaxima(bool autodetectmaxima){m_autodetectMaxima = autodetectmaxima;}
764 
766  wxString MaximaParameters() const {return m_maximaParameters;}
768  void MaximaParameters(wxString parameters){m_maximaParameters = std::move(parameters);}
769 
771  static wxString MaximaDefaultLocation();
772 
774  wxString MaximaLocation() const;
775 
777  wxString MaximaUserLocation() const {return m_maximaUserLocation;}
778 
780  void MaximaUserLocation(wxString maxima) { m_maximaUserLocation = std::move(maxima); }
781 
783  bool AutodetectHelpBrowser() const {return m_autodetectHelpBrowser;}
785  void AutodetectHelpBrowser(bool autodetect){m_autodetectHelpBrowser = autodetect;}
786 
788  bool InternalHelpBrowser() const {return m_useInternalHelpBrowser && OfferInternalHelpBrowser();}
790  void InternalHelpBrowser(bool useInternalHelpBrowser)
791  {m_useInternalHelpBrowser = useInternalHelpBrowser;}
792 
794  bool SinglePageManual() const {return m_singlePageManual;}
796  void SinglePageManual(bool singlePageManual)
797  {m_singlePageManual = singlePageManual;}
798 
800  wxString HelpBrowserUserLocation() const {return m_helpBrowserUserLocation;}
801 
803  void HelpBrowserUserLocation(wxString helpBrowser) { m_helpBrowserUserLocation = std::move(helpBrowser);}
804 
811  static bool MaximaFound(const wxString &location = wxEmptyString);
812 
814  bool FixReorderedIndices() const
815  { return m_fixReorderedIndices; }
816 
817  void FixReorderedIndices(bool fix) { m_fixReorderedIndices = fix;}
818 
820  wxString MathJaXURL() const {
821  if(m_mathJaxURL_UseUser)
822  return m_mathJaxURL;
823  else
824  return MathJaXURL_Auto();}
825  wxString MathJaXURL_User() const { return m_mathJaxURL;}
826  bool MathJaXURL_UseUser() const { return m_mathJaxURL_UseUser;}
827  void MathJaXURL_UseUser(bool useUser){m_mathJaxURL_UseUser = useUser;}
828 
829  bool EnterEvaluates() const {return m_enterEvaluates;}
830  void EnterEvaluates(bool enterEvaluates) {m_enterEvaluates = enterEvaluates;}
831  static wxString MathJaXURL_Auto() { return wxS("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");}
833  void MathJaXURL(wxString url){m_mathJaxURL = std::move(url);}
834 
835  bool CopyBitmap() const {return m_copyBitmap;}
836  void CopyBitmap(bool copyBitmap){ m_copyBitmap = copyBitmap; }
837 
838  bool CopyMathML() const {return m_copyMathML;}
839  void CopyMathML(bool copyMathML){ m_copyMathML = copyMathML;}
840  bool CopyMathMLHTML() const {return m_copyMathMLHTML;}
841  void CopyMathMLHTML(bool copyMathMLHTML){ m_copyMathMLHTML = copyMathMLHTML; }
842  bool HideMarkerForThisMessage(wxString message);
843  void HideMarkerForThisMessage(const wxString &message, bool hide)
844  {m_hideMarkerForThisMessage[message] = hide;}
845  bool CopyRTF() const {return m_copyRTF;}
846  void CopyRTF(bool copyRTF) { m_copyRTF = copyRTF; }
847  bool CopySVG() const {return m_copySVG;}
848  void CopySVG(bool copySVG) { m_copySVG = copySVG; }
849  bool CopyEMF() const {return m_copyEMF;}
850  void CopyEMF(bool copyEMF) { m_copyEMF = copyEMF; }
851  bool UseSVG() const {return m_useSVG;}
852  void UseSVG(bool useSVG) { m_useSVG = useSVG ;}
854  void ShowLength(long length) {
855  m_showLength = length;
856  }
858  long ShowLength() const {return m_showLength;}
860  std::size_t ShowLength_Bytes() const;
861 
864  if(m_parenthesisDrawMode != mode)
865  RecalculateForce();
866  m_parenthesisDrawMode = mode;
867  }
868 
869  void TocShowsSectionNumbers(bool showSectionNumbers) { m_TOCshowsSectionNumbers = showSectionNumbers; }
870 
871  bool TocShowsSectionNumbers() const {return m_TOCshowsSectionNumbers;}
872 
873  void UseUnicodeMaths(bool useunicodemaths)
874  { m_useUnicodeMaths = useunicodemaths; }
875  bool UseUnicodeMaths() const {return m_useUnicodeMaths;}
876 
877  StringBoolHash m_hideMarkerForThisMessage;
878 
883  const Style *GetStyle(TextStyle textStyle) const { return &m_styles[textStyle]; }
891  Style *GetWritableStyle(TextStyle textStyle) { return &m_styles[textStyle]; }
892 
894  wxWindow *GetWorkSheet() const {return m_workSheet;}
896  void SetWorkSheet(wxWindow *workSheet);
897 
898  long DefaultPort() const {return m_defaultPort;}
899  void DefaultPort(long port){m_defaultPort = port;}
900  bool GetAbortOnError() const {return m_abortOnError;}
901  void SetAbortOnError(bool abortOnError) {m_abortOnError = abortOnError;}
902 
903  long GetLanguage() const {return m_language;}
904  void SetLanguage(long language) {m_language = language;}
905 
907  long MaxGnuplotMegabytes() const {return m_maxGnuplotMegabytes;}
908  void MaxGnuplotMegabytes(long megaBytes)
909  {m_maxGnuplotMegabytes = megaBytes;}
910 
911  bool OfferKnownAnswers() const {return m_offerKnownAnswers;}
912  void OfferKnownAnswers(bool offerKnownAnswers)
913  {m_offerKnownAnswers = offerKnownAnswers;}
914 
915  wxString Documentclass() const {return m_documentclass;}
916  void Documentclass(wxString clss){m_documentclass = std::move(clss);}
917  wxString DocumentclassOptions() const {return m_documentclassOptions;}
918  void DocumentclassOptions(wxString classOptions){m_documentclassOptions = std::move(classOptions);}
919 
920 
921  htmlExportFormat HTMLequationFormat() const {return m_htmlEquationFormat;}
922  void HTMLequationFormat(htmlExportFormat HTMLequationFormat)
923  {m_htmlEquationFormat = HTMLequationFormat;}
924 
925  AFontSize GetDefaultFontSize() const { return m_styles[TS_CODE_DEFAULT].GetFontSize(); }
926  AFontSize GetMathFontSize() const { return m_styles[TS_MATH].GetFontSize(); }
927 
929  long GetAutosubscript_Num() const {return m_autoSubscript;}
930  void SetAutosubscript_Num(long autosubscriptnum) {m_autoSubscript = autosubscriptnum;}
931  wxString GetAutosubscript_string() const;
933  wxColor DefaultBackgroundColor();
935  wxColor EditorBackgroundColor();
937  bool ClipToDrawRegion() const {return m_clipToDrawRegion;}
939  void ClipToDrawRegion(bool clipToDrawRegion){m_clipToDrawRegion = clipToDrawRegion; m_forceUpdate = true;}
940  void SetVisibleRegion(wxRect visibleRegion){
941  if(m_visibleRegion.GetWidth() != visibleRegion.GetWidth())
942  RecalculateForce();
943  m_visibleRegion = visibleRegion;
944  }
945  wxRect GetVisibleRegion() const {return m_visibleRegion;}
946  void SetWorksheetPosition(wxPoint worksheetPosition){m_worksheetPosition = worksheetPosition;}
947  wxPoint GetWorksheetPosition() const {return m_worksheetPosition;}
948  wxString MaximaShareDir() const {return m_maximaShareDir;}
949  void MaximaShareDir(wxString dir){m_maximaShareDir = std::move(dir);}
950  void InLispMode(bool lisp){m_inLispMode = lisp;}
951  bool InLispMode() const {return m_inLispMode;}
952  void BitmapScale(int factor){m_bitmapScale = factor;}
953  int BitmapScale() const {return m_bitmapScale;}
954  void DefaultPlotHeight(int px){m_defaultPlotHeight = px;}
955  int DefaultPlotHeight() const {return m_defaultPlotHeight;}
956  void DefaultPlotWidth(int px){m_defaultPlotWidth = px;}
957  int DefaultPlotWidth() const {return m_defaultPlotWidth;}
958  void DefaultFramerate(int fps){m_defaultFramerate = fps;}
959  int DefaultFramerate() const {return m_defaultFramerate;}
960  void TocDepth(int depth){m_tocDepth = depth;}
961  int TocDepth() const {return m_tocDepth;}
962  bool TeXExponentsAfterSubscript() const {return m_TeXExponentsAfterSubscript;}
963  void TeXExponentsAfterSubscript(bool ExponentsAfterSubscript)
964  {m_TeXExponentsAfterSubscript = ExponentsAfterSubscript;}
965  bool UsePartialForDiff() const {return m_usePartialForDiff;}
966  void UsePartialForDiff(bool usePartialForDiff)
967  {m_usePartialForDiff = usePartialForDiff;}
969  void NotifyOfCellRedraw(const Cell *cell);
979  void ReportMultipleRedraws();
981  bool OfferInternalHelpBrowser() const;
982  bool WrapLatexMath() const {return m_wrapLatexMath;}
983  void WrapLatexMath(bool wrapLatexMath){m_wrapLatexMath = wrapLatexMath;}
984  bool AllowNetworkHelp() const {return m_allowNetworkHelp;}
985  void AllowNetworkHelp(bool allowNetworkHelp){m_allowNetworkHelp = allowNetworkHelp;}
986  bool ShowAllDigits() const {return m_showAllDigits;}
987  void ShowAllDigits(bool shw){
988  if(m_showAllDigits != shw)
989  RecalculateForce();
990  m_showAllDigits = shw;
991  }
992  bool LineBreaksInLongNums() const {return m_lineBreaksInLongNums;}
993  void LineBreaksInLongNums(bool brk){
994  if(m_lineBreaksInLongNums != brk)
995  RecalculateForce();
996  m_lineBreaksInLongNums = brk;
997  }
998  int MaxClipbrdBitmapMegabytes() const {return m_maxClipbrd_BitmapMegabytes;}
999  void MaxClipbrdBitmapMegabytes(int maxClipbrd_BitmapMegabytes)
1000  {m_maxClipbrd_BitmapMegabytes = maxClipbrd_BitmapMegabytes;}
1001 
1002  void MaximaUsesHtmlBrowser(bool maximaUsesHhtmlBrowser){m_maximaUsesHhtmlBrowser = maximaUsesHhtmlBrowser;}
1003  bool MaximaUsesHtmlBrowser() const {return m_maximaUsesHhtmlBrowser;}
1004  void MaximaUsesWxmaximaBrowser(bool maximaUsesWxmaximaBrowser){m_maximaUsesWxmaximaBrowser = maximaUsesWxmaximaBrowser;}
1005  bool MaximaUsesWxmaximaBrowser() const {return m_maximaUsesWxmaximaBrowser && OfferInternalHelpBrowser();}
1006  void ExportContainsWXMX(bool exportContainsWXMX){m_exportContainsWXMX = exportContainsWXMX;}
1007  bool ExportContainsWXMX() const {return m_exportContainsWXMX;}
1008  void WizardTab(long tab){m_wizardTab = tab;}
1009  long WizardTab() const {return m_wizardTab;}
1010 
1011  void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
1012  bool Display2d_Unicode() const {return m_display2d_Unicode;}
1013 
1014  wxString TexPreamble() const {return m_texPreamble;}
1015  void TexPreamble(wxString texPreamble) {m_texPreamble = std::move(texPreamble);}
1016 
1017  void SetMaximaVersion(const wxString &version){m_maximaVersion = version;}
1018  wxString GetMaximaVersion() const {return m_maximaVersion;}
1019  void SetMaximaArch(const wxString &arch){m_maximaArch = arch;}
1020  wxString GetMaximaArch() const {return m_maximaArch;}
1021  void SetLispVersion(const wxString &version){m_lispVersion = version;}
1022  wxString GetLispVersion() const {return m_lispVersion;}
1023  void SetLispType(const wxString &type){m_lispType = type;}
1024  wxString GetLispType() const {return m_lispType;}
1025 
1026  Style m_styles[NUMBEROFSTYLES];
1028  void InitStyles();
1030  bool FontRendersChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1031  wxTextCtrl *LastActiveTextCtrl() const { return m_lastActiveTextCtrl; }
1032  void LastActiveTextCtrl(wxTextCtrl *last);
1033 
1035  const std::vector<TextStyle> &GetCodeStylesList() const {return m_codeStyles;}
1037  const std::vector<TextStyle> &GetMathStylesList() const {return m_2dMathStyles;}
1039  const std::vector<TextStyle> &GetColorOnlyStylesList() const {return m_colorOnlyStyles;}
1040  bool StyleAffectsCode(TextStyle style) const;
1041  bool StyleAffectsMathOut(TextStyle style) const;
1042  bool StyleAffectsColorOnly(TextStyle style) const;
1044  bool UpdateNeeded() const;
1046  static void SetDebugmode(){m_debugMode = true;}
1048  static bool GetDebugmode(){return m_debugMode;}
1049  maximaHelpFormat MaximaHelpFormat() const;
1050  void MaximaHelpFormat(maximaHelpFormat format) {m_maximaHelpFormat = format;}
1051 
1052 private:
1053  wxString m_maximaArch;
1054  wxString m_lispVersion;
1055  wxString m_lispType;
1056  wxString m_maximaVersion;
1058  InitOpt m_initOpts;
1064  long m_configId;
1065 public:
1067  std::random_device m_rd;
1069  std::default_random_engine m_eng;
1077  std::int_fast32_t CellCfgCnt() const {return m_cellCfgCnt;}
1078  void RecalculateForce() { m_cellCfgCnt++; }
1079  static bool UseThreads(){return m_use_threads;}
1080  static void UseThreads(bool use){m_use_threads = use;}
1081  static void SetMaximaLang(const wxString &LANG){m_maxima_LANG = LANG;}
1082  static wxString GetMaximaLang(){return m_maxima_LANG;}
1083 private:
1085  static wxString m_maxima_LANG;
1087  std::vector<TextStyle> m_codeStyles;
1089  std::vector<TextStyle> m_2dMathStyles;
1091  std::vector<TextStyle> m_colorOnlyStyles;
1092  std::list<FileToSave> m_filesToSave;
1093  RenderablecharsHash m_renderableChars;
1094  RenderablecharsHash m_nonRenderableChars;
1096  static bool FontDisplaysChar(wxUniChar ch, const wxFont &font = *wxNORMAL_FONT);
1098  static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar, const wxFont &font = *wxNORMAL_FONT);
1099  mathDisplayMode m_displayMode = display_2d;
1100  using CellRedrawTrace = std::vector<const Cell*>;
1101  static bool m_debugMode;
1102  bool m_showInputLabels;
1103  long m_wizardTab;
1104  bool m_display2d_Unicode;
1105  bool m_usePartialForDiff;
1106  bool m_maximaUsesHhtmlBrowser;
1107  bool m_maximaUsesWxmaximaBrowser;
1109  bool m_autoSaveAsTempFile;
1111  long m_language;
1113  bool m_autodetectMaxima;
1115  bool m_autodetectHelpBrowser;
1117  bool m_useInternalHelpBrowser;
1119  bool m_singlePageManual;
1121  wxRect m_updateRegion;
1123  bool m_incrementalSearch;
1125  long m_autoSubscript;
1127  wxWindow *m_workSheet = NULL;
1129  std::unique_ptr<wxClientDC> m_worksheetDC;
1142 // bool CharsExistInFont(const wxFont &font, const wxString& chars);
1144  bool m_wrapLatexMath;
1145  bool m_allowNetworkHelp;
1146  bool m_exportContainsWXMX;
1147  wxString m_texPreamble;
1148 
1149  drawMode m_parenthesisDrawMode;
1150  wxString m_workingdir;
1151  bool m_TeXExponentsAfterSubscript;
1152  wxString m_helpBrowserUserLocation;
1153  wxString m_maximaUserLocation;
1155  bool m_hideBrackets;
1157  double m_printScale;
1158  double m_printMargin_Top;
1159  double m_printMargin_Bot;
1160  double m_printMargin_Left;
1161  double m_printMargin_Right;
1163  wxSize m_canvasSize;
1165  bool m_showBrackets;
1167  bool m_printBrackets;
1173  bool m_changeAsterisk;
1175  bool m_notifyIfIdle;
1177  long m_displayedDigits;
1179  long m_autoWrap;
1181  bool m_autoIndent;
1183  bool m_showAllDigits;
1185  bool m_lineBreaksInLongNums;
1187  bool m_matchParens;
1189  bool m_insertAns;
1191  bool m_openHCaret;
1193  long m_labelWidth;
1194  long m_indent;
1195  bool m_latin2greek;
1196  double m_zoomFactor;
1197  wxDC *m_dc;
1198  wxString m_maximaShareDir;
1199  bool m_forceUpdate;
1200  bool m_clipToDrawRegion = true;
1201  bool m_outdated;
1202  wxString m_maximaParameters;
1203  bool m_keepPercent;
1204  bool m_restartOnReEvaluation;
1205  wxString m_fontCMRI, m_fontCMSY, m_fontCMEX, m_fontCMMI, m_fontCMTI;
1206  bool m_printing;
1207  long m_lineWidth_em;
1208  showLabels m_showLabelChoice;
1209  bool m_fixReorderedIndices;
1210  wxString m_mathJaxURL;
1211  bool m_mathJaxURL_UseUser;
1212  bool m_showCodeCells;
1213  bool m_copyBitmap;
1214  bool m_copyMathML;
1215  bool m_copyMathMLHTML;
1216  long m_showLength;
1218  bool m_inLispMode;
1219  bool m_usepngCairo;
1220  bool m_enterEvaluates;
1221  bool m_useSVG;
1222  bool m_fixedFontTC;
1223  bool m_copyRTF;
1224  bool m_copySVG;
1225  bool m_copyEMF;
1226  bool m_TOCshowsSectionNumbers;
1227  bool m_useUnicodeMaths;
1228  bool m_indentMaths;
1229  bool m_abortOnError;
1230  bool m_showMatchingParens;
1231  bool m_hidemultiplicationsign;
1232  bool m_offerKnownAnswers;
1233  long m_defaultPort;
1234  long m_maxGnuplotMegabytes;
1235  long m_defaultPlotHeight;
1236  long m_defaultPlotWidth;
1237  bool m_saveUntitled;
1238  bool m_cursorJump;
1239  bool m_numpadEnterEvaluates;
1240  bool m_saveImgFileName;
1248  std::unique_ptr<CellRedrawTrace> m_cellRedrawTrace;
1249  wxString m_documentclass;
1250  wxString m_documentclassOptions;
1251  htmlExportFormat m_htmlEquationFormat;
1253  wxRect m_visibleRegion;
1255  wxPoint m_worksheetPosition;
1256 
1257  wxColour m_defaultBackgroundColor;
1259  wxBrush m_BackgroundBrush;
1260  wxBrush m_tooltipBrush;
1261  bool m_greekSidebar_ShowLatinLookalikes;
1262  bool m_greekSidebar_Show_mu;
1263  wxString m_symbolPaneAdditionalChars;
1264  bool m_invertBackground;
1265  long m_undoLimit;
1266  long m_recentItems;
1267  int m_bitmapScale;
1268  int m_defaultFramerate;
1269  int m_tocDepth;
1270  int m_maxClipbrd_BitmapMegabytes;
1271  int m_autoSaveMinutes;
1272  wxString m_wxMathML_Filename;
1273  maximaHelpFormat m_maximaHelpFormat;
1274  wxTextCtrl *m_lastActiveTextCtrl = NULL;
1275  std::int_fast32_t m_cellCfgCnt = 0;
1276  static bool m_use_threads;
1277 };
1278 
1281 {
1282 public:
1283  explicit Printing(Configuration *configuration)
1284  {
1285  m_configuration = configuration;
1286  m_configuration->SetPrinting(true);
1287  }
1288  virtual ~Printing()
1289  {
1290  m_configuration->SetPrinting(false);
1291  }
1292 private:
1293  Configuration * m_configuration;
1294 };
1295 
1298 {
1299 public:
1300  explicit NoClipToDrawRegion(Configuration *configuration)
1301  {
1302  m_configuration = configuration;
1303  m_configuration->ClipToDrawRegion(false);
1304  }
1305  virtual ~NoClipToDrawRegion()
1306  {
1307  m_configuration->ClipToDrawRegion(true);
1308  }
1309 private:
1310  Configuration * m_configuration;
1311 };
1312 
1313 #endif // CONFIGURATION_H
This file declares a message dialog that sends its contents to the log message sink.
This file declares everything needed for the text style system used to style all the elements on the ...
TextStyle
All text styles known to wxMaxima.
Definition: TextStyle.h:231
@ NUMBEROFSTYLES
This is not a style, but its value tells us how many styles are defined.
Definition: TextStyle.h:272
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:98
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:142
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:628
Stores the information about a file we need to write during the save process.
Definition: Configuration.h:644
The configuration storage for the current worksheet.
Definition: Configuration.h:95
wxColor MakeColorDifferFromBackground(wxColor color)
Make this color differ from the background by a noticeable amount.
Definition: Configuration.cpp:1385
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:883
wxString HelpBrowserUserLocation() const
Returns the location of the web browser the user has selected.
Definition: Configuration.h:800
wxColor EditorBackgroundColor()
Determine the default background color of editorcells.
Definition: Configuration.cpp:980
long GetAutosubscript_Num() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:929
bool ShowAutomaticLabels() const
Do we want to show maxima's automatic labels (o1, t1, i1,...)?
Definition: Configuration.h:736
void AutodetectHelpBrowser(bool autodetect)
Autodetect the web browser?
Definition: Configuration.h:785
bool FontRendersChar(wxUniChar ch, const wxFont &font= *wxNORMAL_FONT)
True if we are confident that the font renders this char.
Definition: Configuration.cpp:1413
void MathJaXURL(wxString url)
Returns the URL MathJaX can be found at.
Definition: Configuration.h:833
double GetInterEquationSkip() const
Extra space to leave between two equations in output cells.
Definition: Configuration.h:229
static bool GetDebugmode()
Enable costly checks?
Definition: Configuration.h:1048
bool GetChangeAsterisk() const
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:569
void SetZoomFactor_temporarily(double newzoom)
Sets the zoom factor without storing the new value in the config file/registry.
Definition: Configuration.h:270
void SetAutoWrap(long autoWrap)
Sets the auto wrap mode.
Definition: Configuration.h:463
wxSize GetPPI() const
Get the resolution.
Definition: Configuration.cpp:220
bool GetAutoWrap() const
Do we want to have automatic line breaks for text cells?
Definition: Configuration.h:449
void ClearAndEnableRedrawTracing()
Clear the memory of ReportMultipleRedraws()
Definition: Configuration.cpp:997
void ReportMultipleRedraws()
Report if a cell has been redrawn 2 or more times during a simple Draw() command.
Definition: Configuration.cpp:1006
static wxColour InvertColour(wxColour col)
Inverts a color: In 2020 wxColor still lacks this functionality.
Definition: Configuration.cpp:1042
void FontChanged()
To be called if a font has changed.
Definition: Configuration.h:400
static double GetMaxZoomFactor()
The upper limit we allow for the zoom factor.
Definition: Configuration.h:220
wxBrush GetTooltipBrush() const
Get the brush to be used for worksheet objects that provide a mouse-over tooltip.
Definition: Configuration.h:193
static const wxString & GetEscCode(const wxString &key)
Retrieve a symbol for the escape codes that can be typed after hitting the Escape key in the workshee...
Definition: Configuration.cpp:544
bool HideBrackets() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:244
bool NotifyIfIdle() const
Notify the user if maxima is idle?
Definition: Configuration.h:606
static bool MaximaFound(const wxString &location=wxEmptyString)
Could a maxima binary be found in the path we expect it to be in?
Definition: Configuration.cpp:582
const std::vector< TextStyle > & GetMathStylesList() const
Which styles affect how math output is displayed?
Definition: Configuration.h:1037
static EscCodeIterator EscCodesBegin()
Iterators over the escape code list.
Definition: Configuration.cpp:552
void SetPrinting(bool printing)
Are we currently printing?
Definition: Configuration.cpp:1032
static wxString MaximaDefaultLocation()
The auto-detected maxima location.
Definition: Configuration.cpp:1178
StringHash m_maximaOperators
All maxima operator names we know.
Definition: Configuration.h:146
void SetLabelChoice(showLabels choice)
Sets the value of the Configuration ChoiceBox that treads displaying labels.
Definition: Configuration.h:748
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:1404
void SetKeepPercent(bool keepPercent)
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:504
bool SinglePageManual() const
Prefer the single-page manual?
Definition: Configuration.h:794
void WriteStyles(const wxString &file={})
Saves the style settings.
Definition: Configuration.cpp:1672
wxColor DefaultBackgroundColor()
Determine the default background color of the worksheet.
Definition: Configuration.cpp:973
wxString MaximaUserLocation() const
Returns the location of the maxima binary the user has selected.
Definition: Configuration.h:777
wxCoord GetLabelWidth() const
Get the width of worksheet labels [in unscaled pixels].
Definition: Configuration.h:310
void WriteSettings(const wxString &file={})
Saves the settings to a file.
Definition: Configuration.cpp:1250
mathDisplayMode DisplayMode() const
Does maxima output 1D, 2D or 2D ASCII equations?
Definition: Configuration.h:153
wxCoord GetIndent() const
Get the indentation of GroupCells.
Definition: Configuration.h:325
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1077
bool ShowLabels() const
Do we want at all to show labels?
Definition: Configuration.h:744
static std::unordered_map< TextStyle, wxString > m_styleNames
The list of names for the worksheet's text styles.
Definition: Configuration.h:204
std::random_device m_rd
Our random device.
Definition: Configuration.h:1067
wxString MaximaParameters() const
Parameters to the maxima binary.
Definition: Configuration.h:766
wxDC * GetRecalcDC() const
Get a drawing context suitable for size calculations.
Definition: Configuration.h:288
wxSize GetCanvasSize() const
Reads the size of the current worksheet's visible window. See SetCanvasSize.
Definition: Configuration.h:690
void InternalHelpBrowser(bool useInternalHelpBrowser)
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:790
double GetZoomFactor() const
Determines the zoom factor the worksheet is displayed at.
Definition: Configuration.h:284
long LineWidth_em() const
The minimum sensible line width in widths of a letter.
Definition: Configuration.h:416
void SinglePageManual(bool singlePageManual)
Prefer the single-page manual?
Definition: Configuration.h:796
bool IndentMaths() const
Do we want to indent all maths?
Definition: Configuration.h:472
wxString MaximaLocation() const
Returns the location of the maxima binary.
Definition: Configuration.cpp:1171
void SetBackgroundBrush(const wxBrush &brush)
Set the brush to be used for the worksheet background.
Definition: Configuration.cpp:576
bool FixedFontInTextControls() const
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:187
bool GetAutoIndent() const
Do we want automatic indentation?
Definition: Configuration.h:466
long LabelWidth() const
Get the width of worksheet labels [in chars].
Definition: Configuration.h:314
void SetRecalcContext(wxDC &dc)
Set the drawing context that is currently active.
Definition: Configuration.h:178
double PrintScale() const
Hide brackets that are not under the pointer?
Definition: Configuration.h:251
wxString GetWorkingDirectory() const
Get maxima's working directory.
Definition: Configuration.h:162
long GetBaseIndent() const
The y position the worksheet starts at.
Definition: Configuration.h:359
const std::vector< TextStyle > & GetCodeStylesList() const
Which styles affect how code is displayed?
Definition: Configuration.h:1035
void DisplayMode(mathDisplayMode mode)
Tell the config if maxima outputs 1D, 2D or 2D ASCII equations, currently.
Definition: Configuration.h:155
static bool GetAutoWrapCode()
Do we want to have automatic line breaks for code cells?
Definition: Configuration.h:454
long MaxGnuplotMegabytes() const
The maximum number of Megabytes of gnuplot sources we should store.
Definition: Configuration.h:907
long GetGroupSkip() const
The vertical space between GroupCells.
Definition: Configuration.h:368
void HelpBrowserUserLocation(wxString helpBrowser)
Sets the location of the web browser the user has detected.
Definition: Configuration.h:803
void SetWorkingDirectory(wxString dir)
Set maxima's working directory.
Definition: Configuration.h:158
bool CheckKeepPercent() const
Do we want to display "%e" as "%e" and "%pi" as "%pi"?
Definition: Configuration.h:500
wxString MathJaXURL() const
Returns the URL MathJaX can be found at.
Definition: Configuration.h:820
void AutodetectMaxima(bool autodetectmaxima)
Autodetect maxima's location?
Definition: Configuration.h:763
void SetChangeAsterisk(bool changeAsterisk)
Use Unicode centered dots for multiplication signs?
Definition: Configuration.h:572
std::default_random_engine m_eng
Our random engine.
Definition: Configuration.h:1069
void PrintScale(double scale)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:255
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Configuration.cpp:204
void InitStyles()
Initialize the text styles on construction.
Definition: Configuration.cpp:487
static void SetDebugmode()
Enable costly checks.
Definition: Configuration.h:1046
static double GetMinZoomFactor()
The lower limit we allow for the zoom factor.
Definition: Configuration.h:216
bool AutodetectMaxima() const
Autodetect maxima's location? (If false the user-specified location is used)
Definition: Configuration.h:761
bool ClipToDrawRegion() const
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:937
void SetZoomFactor(double newzoom)
Sets the zoom factor the worksheet is displayed at.
Definition: Configuration.cpp:1074
bool ShowBrackets() const
Show the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:702
bool FixReorderedIndices() const
Renumber out-of-order cell labels on saving.
Definition: Configuration.h:814
bool GetPrinting() const
Are we currently printing?
Definition: Configuration.h:545
wxBrush GetBackgroundBrush() const
Get the brush to be used for the worksheet background.
Definition: Configuration.h:191
void SetIndent(long indent)
Set the indentation of GroupCells.
Definition: Configuration.h:380
Style * GetWritableStyle(TextStyle textStyle)
Get the text Style for a given text style identifier.
Definition: Configuration.h:891
long GetLineWidth() const
Returns the maximum sensible width for a text line [in characters]:
Definition: Configuration.cpp:1047
void FixedFontInTextControls(bool fixed)
Use a typewriter font in wizard entry fields that can contain maxima commands?
Definition: Configuration.h:189
static EscCodeIterator EscCodesEnd()
Iterators over the escape code list.
Definition: Configuration.cpp:555
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1373
wxCoord GetCellBracketWidth() const
The width we allocate for our cell brackets.
Definition: Configuration.h:238
void MaximaUserLocation(wxString maxima)
Sets the location of the maxima binary.
Definition: Configuration.h:780
Configuration(wxDC *dc={}, InitOpt options=none)
The constructor.
Definition: Configuration.cpp:55
bool OfferInternalHelpBrowser() const
If we decide that the HTML browser in the sidebar doesn't work for every platform....
Definition: Configuration.cpp:1518
void ClipToDrawRegion(bool clipToDrawRegion)
Do we want to save time by only redrawing the area currently shown on the screen?
Definition: Configuration.h:939
wxColour GetColor(TextStyle style)
Gets the color for a text style.
Definition: Configuration.cpp:1362
long GetCursorWidth() const
How much vertical space is to be left between two group cells?
Definition: Configuration.h:343
static wxString m_configfileLocation_override
Where to store the configuration.
Definition: Configuration.h:201
void LineWidth_em(long width)
Set the minimum sensible line width in widths of a letter.
Definition: Configuration.h:428
void HideBrackets(bool hide)
Define if we want to hide brackets that are not under the pointer.
Definition: Configuration.h:248
double GetDefaultLineWidth() const
Calculates the default line width for the worksheet.
Definition: Configuration.h:407
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:607
InitOpt
Definition: Configuration.h:128
@ temporary
This configuration is temporary and shouldn't redetect Maxima etc.
Definition: Configuration.h:130
bool InternalHelpBrowser() const
Use the internal help browser? If not a external web browser is used.
Definition: Configuration.h:788
void SetParenthesisDrawMode(drawMode mode)
Which way do we want to draw parenthesis?
Definition: Configuration.h:863
drawMode
Definition: Configuration.h:122
@ ascii
Use ascii characters only.
Definition: Configuration.h:123
@ handdrawn
A parenthesis sign that was created using draw commands.
Definition: Configuration.h:124
void SetCanvasSize(wxSize siz)
Sets the size of the current worksheet's visible window.
Definition: Configuration.h:694
void MaximaParameters(wxString parameters)
The parameters we pass to the maxima binary.
Definition: Configuration.h:768
void NotifyOfCellRedraw(const Cell *cell)
Record that this cell has been drawn to ReportMultipleRedraws()
Definition: Configuration.cpp:987
long ShowLength() const
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:858
const std::vector< TextStyle > & GetColorOnlyStylesList() const
Which styles affect only colors?
Definition: Configuration.h:1039
void ResetAllToDefaults()
Reset the whole configuration to its default values.
Definition: Configuration.cpp:242
void ReadStyles(const wxString &file={})
Reads the style settings.
Definition: Configuration.cpp:1182
htmlExportFormat
The export formats we support for HTML equations.
Definition: Configuration.h:104
bool IsOperator(wxString name)
Coincides name with a operator known to maxima?
Definition: Configuration.h:148
bool UseUserLabels() const
Do we want at all to show labels?
Definition: Configuration.h:740
bool UpdateNeeded() const
true means: The system's config storage has changed since the configuration has been read
Definition: Configuration.cpp:1534
std::size_t ShowLength_Bytes() const
The "maximum output length to display" setting in cells.
Definition: Configuration.cpp:1693
long GetDisplayedDigits() const
Returns the maximum number of displayed digits.
Definition: Configuration.h:615
bool AutodetectHelpBrowser() const
Autodetect the web browser? (If false the user-specified location is used)
Definition: Configuration.h:783
void ShowLength(long length)
The choice for the "maximum output length to display" setting.
Definition: Configuration.h:854
void LabelWidth(long labelWidth)
Set the width of worksheet labels [in chars].
Definition: Configuration.h:317
wxWindow * GetWorkSheet() const
Get the worksheet this configuration storage is valid for.
Definition: Configuration.h:894
bool PrintBrackets() const
Print the cell brackets [displayed left to each group cell showing its extend]?
Definition: Configuration.h:713
Clears the configuration's "Clip to draw region" flag until this class is left.
Definition: Configuration.h:1298
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1281
Text Style Definition.
Definition: TextStyle.h:63
AFontSize GetFontSize() const
The size of this style's font, asserted to be valid.
Definition: TextStyle.cpp:101
Definition: Configuration.h:392