wxMaxima
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Configuration Class Reference

#include <Configuration.h>

Collaboration diagram for Configuration:
Collaboration graph
[legend]

Classes

struct  CharsExist
 

Public Types

enum  htmlExportFormat { mathJaX_TeX = 0, bitmap = 1, mathML_mathJaX = 2, svg = 3 }
 The export formats we support for HTML equations.
 
enum  showLabels : int8_t { labels_automatic = 0, labels_prefer_user = 1, labels_useronly = 2, labels_none = 3 }
 
enum  drawMode {
  ascii, assembled_unicode_fallbackfont, assembled_unicode, assembled_unicode_fallbackfont2,
  handdrawn, unknown
}
 
enum  InitOpt { none, temporary }
 
enum  mathDisplayMode { display_2d, display_2dASCII, display_1dASCII }
 
using EscCodeContainer = std::unordered_map< wxString, wxString, wxStringHash >
 
using EscCodeIterator = EscCodeContainer::const_iterator
 

Public Member Functions

 WX_DECLARE_STRING_HASH_MAP (int, StringHash)
 
const wxEnvVariableHashMap & MaximaEnvVars ()
 
mathDisplayMode DisplayMode ()
 
void DisplayMode (mathDisplayMode mode)
 
void SetWorkingDirectory (wxString dir)
 Set maxima's working directory.
 
wxString GetWorkingDirectory () const
 
void ReadConfig ()
 
 Configuration (wxDC *dc={}, InitOpt options={})
 
void ResetAllToDefaults (InitOpt options={})
 
void SetContext (wxDC &dc)
 Set the drawing context that is currently active.
 
void UnsetContext ()
 
void SetBackgroundBrush (wxBrush brush)
 
bool FixedFontInTextControls ()
 
void FixedFontInTextControls (bool fixed)
 
wxBrush GetBackgroundBrush () const
 
wxBrush GetTooltipBrush () const
 
void SetAntialiassingDC (wxDC &antialiassingDC)
 
void UnsetAntialiassingDC ()
 
double GetInterEquationSkip () const
 
long GetCellBracketWidth () const
 
bool HideBrackets () const
 Hide brackets that are not under the pointer?
 
void HideBrackets (bool hide)
 Define if we want to hide brackets that are not under the pointer.
 
double PrintScale () const
 Hide brackets that are not under the pointer?
 
void PrintScale (double scale)
 Define if we want to hide brackets that are not under the pointer.
 
void SetZoomFactor (double newzoom)
 Sets the zoom factor the worksheet is displayed at.
 
void SetZoomFactor_temporarily (double newzoom)
 Sets the zoom factor without storing the new value in the config file/registry.
 
long Scale_Px (double px) const
 
AFontSize Scale_Px (AFontSize size) const
 
double GetZoomFactor () const
 Determines the zoom factor the worksheet is displayed at.
 
wxDC * GetDC ()
 Get a drawing context suitable for size calculations.
 
wxDC * GetAntialiassingDC ()
 Get a drawing context suitable for size calculations.
 
AFontName GetFontName (TextStyle ts=TS_DEFAULT) const
 
AFontName GetSymbolFontName () const
 
wxFontWeight IsBold (long st) const
 
wxFontStyle IsItalic (long st) const
 
bool IsUnderlined (long st) const
 
long GetLabelWidth () const
 
long LabelWidth () const
 
void LabelWidth (long labelWidth)
 
long GetIndent () const
 Get the indentation of GroupCells.
 
void SetPPI (wxSize ppi)
 
wxSize GetPPI () const
 
int AutosaveMinutes ()
 
void AutosaveMinutes (int minutes)
 
long GetCursorWidth () const
 How much vertical space is to be left between two group cells?
 
long GetBaseIndent () const
 The y position the worksheet starts at.
 
long GetGroupSkip () const
 The vertical space between GroupCells.
 
void SetIndent (long indent)
 
void SetClientWidth (long width)
 Set the width of the visible window for GetClientWidth()
 
bool IncrementalSearch () const
 
void IncrementalSearch (bool incrementalSearch)
 
void FontChanged ()
 Has a font changed?
 
void SetClientHeight (long height)
 Set the height of the visible window for GetClientHeight()
 
long GetClientWidth () const
 Returns the width of the visible portion of the worksheet.
 
long GetClientHeight () const
 Returns the height of the visible portion of the worksheet.
 
double GetDefaultLineWidth () const
 Calculates the default line width for the worksheet.
 
long LineWidth_em () const
 The minimum sensible line width in widths of a letter.
 
bool AutoSaveAsTempFile () const
 
void AutoSaveAsTempFile (bool asTempFile)
 
void LineWidth_em (long width)
 Set the minimum sensible line width in widths of a letter.
 
long GetLineWidth () const
 Returns the maximum sensible width for a text line [in characters]:
 
bool SaveUntitled ()
 
void SaveUntitled (bool save)
 
bool CursorJump ()
 
void CursorJump (bool save)
 
bool NumpadEnterEvaluates ()
 
void NumpadEnterEvaluates (bool eval)
 
bool SaveImgFileName ()
 
void SaveImgFileName (bool save)
 
bool GetAutoWrap () const
 Do we want to have automatic line breaks for text cells?
 
bool GetAutoWrapCode () const
 Do we want to have automatic line breaks for code cells?
 
void SetAutoWrap (long autoWrap)
 
bool GetAutoIndent () const
 Do we want automatic indentation?
 
void SetAutoIndent (bool autoIndent)
 
bool IndentMaths () const
 Do we want to indent all maths?
 
void IndentMaths (bool indent)
 
AFontSize GetFontSize (TextStyle st) const
 
const wxString & GetStyleName (TextStyle textStyle) const
 
void ReadStyles (const wxString &file={})
 
void WriteStyles (const wxString &file={})
 Saves the style settings to a file. More...
 
void WriteStyles (wxConfigBase *config)
 
void WriteSettings (const wxString &file={})
 Saves the style settings to a file.
 
void Outdated (bool outdated)
 
bool CheckTeXFonts () const
 
void CheckTeXFonts (bool check)
 
bool CheckKeepPercent () const
 
void SetKeepPercent (bool keepPercent)
 
AFontName GetTeXCMRI () const
 
AFontName GetTeXCMSY () const
 
AFontName GetTeXCMEX () const
 
AFontName GetTeXCMMI () const
 
AFontName GetTeXCMTI () const
 
bool ShowCodeCells () const
 
void ShowCodeCells (bool show)
 
void SetPrinting (bool printing)
 
bool GetPrinting () const
 
wxColour GetColor (TextStyle style)
 Gets the color for a text style.
 
wxColour InvertColour (wxColour col)
 Inverts a color: In 2020 wxColor still lacks this functionality.
 
wxColor MakeColorDifferFromBackground (wxColor color)
 
bool UsePngCairo () const
 
void UsePngCairo (bool usepngCairo)
 
bool GetMatchParens () const
 
void SetMatchParens (bool matchParens)
 
bool ShowMatchingParens () const
 
void ShowMatchingParens (bool show)
 
bool GetChangeAsterisk () const
 
void SetChangeAsterisk (bool changeAsterisk)
 
bool HidemultiplicationSign () const
 
void HidemultiplicationSign (bool show)
 
bool Latin2Greek () const
 
void Latin2Greek (bool latin2greek)
 
bool GreekSidebar_ShowLatinLookalikes () const
 
void GreekSidebar_ShowLatinLookalikes (bool show)
 
bool GreekSidebar_Show_mu () const
 
void GreekSidebar_Show_mu (bool show)
 
wxString SymbolPaneAdditionalChars () const
 
void SymbolPaneAdditionalChars (wxString symbols)
 
bool NotifyIfIdle () const
 Notify the user if maxima is idle?
 
void NotifyIfIdle (bool notify)
 
long GetDisplayedDigits () const
 
void SetDisplayedDigits (long displayedDigits)
 
wxRect GetUpdateRegion () const
 
void SetUpdateRegion (wxRect rect)
 
bool InUpdateRegion (wxRect rect) const
 
bool GetInsertAns () const
 
void SetInsertAns (bool insertAns)
 
bool GetOpenHCaret () const
 
void SetOpenHCaret (bool openHCaret)
 
bool RestartOnReEvaluation () const
 
void RestartOnReEvaluation (bool arg)
 
wxSize GetCanvasSize () const
 Reads the size of the current worksheet's visible window. See SetCanvasSize.
 
void SetCanvasSize (wxSize siz)
 Sets the size of the current worksheet's visible window.
 
bool ShowBrackets () const
 Show the cell brackets [displayed left to each group cell showing its extend]?
 
bool ShowBrackets (bool show)
 
bool PrintBrackets () const
 Prlong the cell brackets [displayed left to each group cell showing its extend]?
 
showLabels GetLabelChoice () const
 
bool InvertBackground ()
 
void InvertBackground (bool invert)
 
long UndoLimit ()
 
void UndoLimit (long limit)
 
long RecentItems ()
 
void RecentItems (long items)
 
bool ShowAutomaticLabels () const
 Do we want to show maxima's automatic labels (o1, t1, i1,...)?
 
bool UseUserLabels () const
 Do we want at all to show labels?
 
bool ShowLabels () const
 Do we want at all to show labels?
 
void SetLabelChoice (showLabels choice)
 Sets the value of the Configuration ChoiceBox that treads displaying labels.
 
bool PrintBrackets (bool print)
 
bool AutodetectMaxima () const
 Autodetect maxima's location? (If false the user-specified location is used)
 
void AutodetectMaxima (bool autodetectmaxima)
 Autodetect maxima's location?
 
wxString MaximaParameters () const
 Parameters to the maxima binary.
 
void MaximaParameters (wxString parameters)
 The parameters we pass to the maxima binary.
 
wxString MaximaLocation () const
 Returns the location of the maxima binary.
 
wxString MaximaUserLocation () const
 Returns the location of the maxima binary the user has selected.
 
void OnMpBrowse (wxCommandEvent &event)
 
void MaximaUserLocation (wxString maxima)
 Sets the location of the maxima binary.
 
bool AutodetectHelpBrowser () const
 Autodetect maxima's location? (If false the user-specified location is used)
 
void AutodetectHelpBrowser (bool autodetect)
 Autodetect maxima's location?
 
wxString HelpBrowserUserLocation () const
 Returns the location of the help browser the user has selected.
 
void HelpBrowserUserLocation (wxString helpBrowser)
 Sets the location of the maxima binary.
 
bool FixReorderedIndices () const
 Renumber out-of-order cell labels on saving.
 
void FixReorderedIndices (bool fix)
 
wxString MathJaXURL () const
 Returns the URL MathJaX can be found at.
 
wxString MathJaXURL_User () const
 
bool MathJaXURL_UseUser () const
 
void MathJaXURL_UseUser (bool useUser)
 
bool WxMathML_UseFile () const
 
void WxMathML_UseFile (bool useFile)
 
wxString WxMathML_Filename () const
 
void WxMathML_Filename (wxString name)
 
bool EnterEvaluates () const
 
void EnterEvaluates (bool enterEvaluates)
 
void MathJaXURL (wxString url)
 Returns the URL MathJaX can be found at.
 
bool AntiAliasLines () const
 
void AntiAliasLines (bool antiAlias)
 
bool CopyBitmap () const
 
void CopyBitmap (bool copyBitmap)
 
bool CopyMathML () const
 
void CopyMathML (bool copyMathML)
 
bool CopyMathMLHTML () const
 
void CopyMathMLHTML (bool copyMathMLHTML)
 
bool HideMarkerForThisMessage (wxString message)
 
void HideMarkerForThisMessage (wxString message, bool hide)
 
bool CopyRTF () const
 
void CopyRTF (bool copyRTF)
 
bool CopySVG () const
 
void CopySVG (bool copySVG)
 
bool CopyEMF () const
 
void CopyEMF (bool copyEMF)
 
bool UseSVG ()
 
void UseSVG (bool useSVG)
 
void ShowLength (long length)
 
long ShowLength () const
 
void LispType (wxString type)
 
wxString LispType () const
 
void SetParenthesisDrawMode (drawMode mode)
 Which way do we want to draw parenthesis?
 
void TocShowsSectionNumbers (bool showSectionNumbers)
 
bool TocShowsSectionNumbers () const
 
void UseUnicodeMaths (bool useunicodemaths)
 
bool UseUnicodeMaths () const
 
drawMode GetParenthesisDrawMode ()
 
 WX_DECLARE_STRING_HASH_MAP (bool, StringBoolHash)
 
Style GetStyle (TextStyle textStyle, AFontSize fontSize) const
 
wxWindow * GetWorkSheet () const
 Get the worksheet this configuration storage is valid for.
 
void SetWorkSheet (wxWindow *workSheet)
 Set the worksheet this configuration storage is valid for.
 
long DefaultPort () const
 
void DefaultPort (long port)
 
bool GetAbortOnError () const
 
void SetAbortOnError (bool abortOnError)
 
long GetLanguage () const
 
void SetLanguage (long language)
 
long MaxGnuplotMegabytes () const
 The maximum number of Megabytes of gnuplot sources we should store.
 
void MaxGnuplotMegabytes (long megaBytes)
 
bool OfferKnownAnswers () const
 
void OfferKnownAnswers (bool offerKnownAnswers)
 
wxString Documentclass () const
 
void Documentclass (wxString clss)
 
wxString DocumentclassOptions () const
 
void DocumentclassOptions (wxString classOptions)
 
htmlExportFormat HTMLequationFormat () const
 
void HTMLequationFormat (htmlExportFormat HTMLequationFormat)
 
AFontSize GetDefaultFontSize () const
 
AFontSize GetMathFontSize () const
 
long GetAutosubscript_Num () const
 Get the worksheet this configuration storage is valid for.
 
void SetAutosubscript_Num (long autosubscriptnum)
 
wxString GetAutosubscript_string () const
 
wxColor DefaultBackgroundColor ()
 Determine the default background color of the worksheet.
 
wxColor EditorBackgroundColor ()
 Determine the default background color of editorcells.
 
bool ClipToDrawRegion () const
 Do we want to save time by only redrawing the area currently shown on the screen?
 
void ClipToDrawRegion (bool clipToDrawRegion)
 Do we want to save time by only redrawing the area currently shown on the screen?
 
void AdjustWorksheetSize (bool adjust)
 Request adjusting the worksheet size?
 
bool AdjustWorksheetSize () const
 
void SetVisibleRegion (wxRect visibleRegion)
 
wxRect GetVisibleRegion () const
 
void SetWorksheetPosition (wxPoint worksheetPosition)
 
wxPoint GetWorksheetPosition () const
 
wxString MaximaShareDir () const
 
void MaximaShareDir (wxString dir)
 
void InLispMode (bool lisp)
 
bool InLispMode () const
 
void BitmapScale (int factor)
 
int BitmapScale () const
 
void DefaultPlotHeight (int px)
 
int DefaultPlotHeight () const
 
void DefaultPlotWidth (int px)
 
int DefaultPlotWidth () const
 
void DefaultFramerate (int fps)
 
int DefaultFramerate () const
 
void TocDepth (int depth)
 
int TocDepth () const
 
bool TeXExponentsAfterSubscript () const
 
void TeXExponentsAfterSubscript (bool ExponentsAfterSubscript)
 
bool UsePartialForDiff () const
 
void UsePartialForDiff (bool usePartialForDiff)
 
void NotifyOfCellRedraw (const Cell *cell)
 
void ClearAndEnableRedrawTracing ()
 
void ReportMultipleRedraws ()
 
bool WrapLatexMath () const
 
void WrapLatexMath (bool wrapLatexMath)
 
bool ShowAllDigits () const
 
void ShowAllDigits (bool shw)
 
bool LineBreaksInLongNums () const
 
void LineBreaksInLongNums (bool brk)
 
int MaxClipbrdBitmapMegabytes () const
 
void MaxClipbrdBitmapMegabytes (int maxClipbrd_BitmapMegabytes)
 
void ExportContainsWXMX (bool exportContainsWXMX)
 
bool ExportContainsWXMX () const
 
wxString TexPreamble () const
 
void TexPreamble (wxString texPreamble)
 
void InitStyles ()
 Initialize the text styles on construction.
 

Static Public Member Functions

static const wxString & GetEscCode (const wxString &key)
 Retrieve a symbol for the escape code typed after the Escape key.
 
static EscCodeIterator EscCodesBegin ()
 Iterators over the escape code list.
 
static EscCodeIterator EscCodesEnd ()
 
static double GetMinZoomFactor ()
 
static double GetMaxZoomFactor ()
 
static wxString MaximaDefaultLocation ()
 The auto-detected maxima location.
 
static bool MaximaFound (wxString location=wxEmptyString)
 
static wxString MathJaXURL_Auto ()
 

Public Attributes

StringHash m_maximaOperators
 
wxEnvVariableHashMap m_maximaEnvVars
 
std::vector< CharsExistm_charsInFont
 
StringBoolHash m_hideMarkerForThisMessage
 
Style m_styles [NUMBEROFSTYLES]
 

Static Public Attributes

static wxString m_maximaLocation_override
 
static wxString m_configfileLocation_override
 

Detailed Description

The configuration storage for the current worksheet.

Caching the information here means we don't need to search for the configuration value's name every time we need the information: Reading configuration values from the system's configuration storage can be quite time consuming, especially on a MSW with a long registry.

In order to make all cells temporary listen to a different set of configuration than the default one all that has to be done is to create a new configuration object that contains hold the right settings for printing/export as bitmap or similar: Configuration::Get() will always return the last Configuration that was created and therefore as long as the new configuration object exist will return a pointer to this object if configuration is needed.

Member Enumeration Documentation

◆ drawMode

Enumerator
ascii 

Use ascii characters only.

assembled_unicode_fallbackfont 

Unicode, fallbackfont 1.

assembled_unicode 

Unicode, current font.

assembled_unicode_fallbackfont2 

Unicode, fallbackfont 2.

handdrawn 

A parenthesis sign that was created using draw commands.

◆ InitOpt

Enumerator
temporary 

This configuration is temporary and shouldn't redetect Maxima etc.

Constructor & Destructor Documentation

◆ Configuration()

Configuration::Configuration ( wxDC *  dc = {},
InitOpt  options = {} 
)
explicit

The constructor

Parameters
dcThe drawing context that is to be used for drawing objects

Member Function Documentation

◆ GetDisplayedDigits()

long Configuration::GetDisplayedDigits ( ) const
inline

Returns the maximum number of displayed digits

m_displayedDigits is always >= 20, so we can guarantee the number we return to be unsigned.

◆ GetInterEquationSkip()

double Configuration::GetInterEquationSkip ( ) const
inline

Extra space to leave between two equations in output cells.

Extra space between equations is useful if we don't display labels that show which line begins a new equation and which line merely continues a multi-line equation.

◆ GetPPI()

wxSize Configuration::GetPPI ( ) const

Get the resolution

During recalculation the drawing context doesn't know the display's resolution so we need to do some additional tricks here.

◆ GetPrinting()

bool Configuration::GetPrinting ( ) const
inline

Are we currently printing?

This affects the bitmap scale as well as the fact if we want to output objects that are outside the region that currently is redrawn.

◆ GetStyle()

Style Configuration::GetStyle ( TextStyle  textStyle,
AFontSize  fontSize 
) const

Get the resolved text Style for a given text style identifier.

Parameters
textStyleThe text style to resolve the style for.
fontSizeOnly relevant for math cells: Super- and subscripts can have different font styles than the rest.

◆ InUpdateRegion()

bool Configuration::InUpdateRegion ( wxRect  rect) const

Whether any part of the given rectangle is within the current update region, or true if drawing is not clipped to update region.

◆ MakeColorDifferFromBackground()

wxColor Configuration::MakeColorDifferFromBackground ( wxColor  color)

Make this color differ from the background by a noticeable amount

Useful for black/white background theme changes

◆ MaximaFound()

bool Configuration::MaximaFound ( wxString  location = wxEmptyString)
static

Could a maxima binary be found in the path we expect it to be in?

Parameters
locationThe location to search for maxima in. If location == wxEmptyString the default location from the configuration is taken.

◆ ReadStyles()

void Configuration::ReadStyles ( const wxString &  file = {})

Reads the style settings

If a file name is given the settings are read from a file.

◆ Scale_Px()

long Configuration::Scale_Px ( double  px) const

Scales a distance [in pixels] according to the zoom factor

Is used for displaying/printing/exporting of text/maths.

◆ SetAutoWrap()

void Configuration::SetAutoWrap ( long  autoWrap)
inline

Sets the auto wrap mode

Parameters
autoWrap
  • 0: No automatic line breaks
  • 1: Automatic line breaks only for text cells
  • 2: Automatic line breaks for text and code cells.

◆ SetIndent()

void Configuration::SetIndent ( long  indent)
inline

Set the indentation of GroupCells

Normally this parameter is automatically calculated

◆ SetPrinting()

void Configuration::SetPrinting ( bool  printing)

Are we currently printing?

This affects the bitmap scale as well as the fact if we want to output objects that are outside the region that currently is redrawn.

◆ WriteStyles()

void Configuration::WriteStyles ( const wxString &  file = {})

Saves the style settings to a file.

Saves the style settings

If a file name is given the settings are written to a file.

Member Data Documentation

◆ m_maximaOperators

StringHash Configuration::m_maximaOperators

All maxima operator names we know


The documentation for this class was generated from the following files: