wxMaxima
Cell.h
Go to the documentation of this file.
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 // Copyright (C) 2014-2018 Gunter Königsmann <wxMaxima@physikbuch.de>
5 // Copyright (C) 2020 Kuba Ober <kuba@bertec.com>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // SPDX-License-Identifier: GPL-2.0+
23 
29 #ifndef MATHCELL_H
30 #define MATHCELL_H
31 
32 #include "../precomp.h"
33 #include "CellPtr.h"
34 #include "CellIterators.h"
35 #include "Configuration.h"
36 #include "StringUtils.h"
37 #include "TextStyle.h"
38 #include "utils/CachedValue.h"
39 #include <wx/defs.h>
40 #if wxUSE_ACCESSIBILITY
41 #include <wx/access.h>
42 #endif // wxUSE_ACCESSIBILITY
43 #include <algorithm>
44 #include <map>
45 #include <memory>
46 #include <vector>
47 #include <type_traits>
48 class CellPointers;
49 class EditorCell;
50 class GroupCell;
51 class TextCell;
52 class Worksheet;
53 class wxXmlNode;
54 
55 // Forward declarations
56 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type = true>
57 inline auto OnInner(const C *cell);
58 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type = true>
59 inline auto OnInner(C *cell);
60 
63 enum CellType : int8_t
64 {
65  MC_TYPE_DEFAULT,
83 };
84 
85 #if wxUSE_ACCESSIBILITY
86 class CellAccessible;
87 #endif
88 
91 {
92 public:
98  virtual const wxString &GetName() const = 0;
99 };
100 
138 // 120 bytes
139 class Cell: public Observed
140 {
141 #if wxUSE_ACCESSIBILITY
142  friend class CellAccessible;
143 #endif
144  friend class CellList;
145 
146  // This class can be derived from wxAccessible which has no copy constructor
147  void operator=(const Cell&) = delete;
148  Cell(GroupCell *group, const Cell&) = delete;
149 
150  template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type>
151  friend inline auto OnInner(const C *cell);
152  template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type>
153  friend inline auto OnInner(C *cell);
154 
155 public:
156 // Cell(GroupCell *group, Configuration **config);
157  Cell(GroupCell *group, Configuration **config);
158 
164  virtual std::unique_ptr<Cell> Copy(GroupCell *group) const = 0;
165 
167  virtual const CellTypeInfo &GetInfo() = 0;
168 
173  int Scale_Px(double px) const {return (*m_configuration)->Scale_Px(px);}
174  AFontSize Scale_Px(AFontSize size) const { return (*m_configuration)->Scale_Px(size); }
175 
176 #if wxUSE_ACCESSIBILITY
177  // The methods whose implementation within Cell should be sufficient are
178  // not virtual. Should that prove not to be the case eventually, they can be
179  // made virtual with due caution.
181  wxAccStatus GetParent (Cell ** parent) const;
183  wxAccStatus GetChild(int childId, Cell **child) const;
185  wxAccStatus HitTest (const wxPoint &pt, int *childId, Cell **child);
186 
188  virtual wxAccStatus GetDescription(int childId, wxString *description) const;
190  virtual wxAccStatus GetFocus (int *childId, Cell **child) const;
192  virtual wxAccStatus GetDefaultAction(int childId, wxString *actionName) const;
194  virtual wxAccStatus GetLocation (wxRect &rect, int elementId);
196  virtual wxAccStatus GetValue (int childId, wxString *strValue) const;
197  virtual wxAccStatus GetRole (int childId, wxAccRole *role) const;
198 #endif
199 
200 
208  virtual const wxString &GetToolTip(wxPoint point) const;
209 
211  virtual ~Cell();
212 
214  int CellsInListRecursive() const;
215 
217  wxRect CropToUpdateRegion(wxRect rect) const;
218 
220  bool InUpdateRegion() const;
221 
223  bool SoftLineBreak(bool breakLine = true)
224  {
225  bool result = (m_breakLine == breakLine);
226  m_breakLine = breakLine;
227  return result;
228  }
229 
231  bool BreakLineHere() const { return m_breakLine || m_forceBreakLine; }
232 
234  bool HasHardLineBreak() const { return m_forceBreakLine; }
235 
240  virtual bool BreakUp();
241 
242 protected:
244  void BreakUpAndMark();
245 
246 public:
254  bool ContainsRect(const wxRect &sm, bool all = true) const;
255 
260  bool ContainsPoint(wxPoint point) const { return GetRect().Contains(point); }
261 
267  virtual void ClearCache()
268  {}
269 
274  void ClearCacheList();
275  void SetConfigurationList(Configuration **config);
276  virtual void SetConfiguration(Configuration **config);
277  Configuration *GetConfiguration(){return *m_configuration;}
278 
279 
289  virtual void Draw(wxPoint point);
290 
291  void Draw(){Draw(m_currentPoint);}
292 
297  void DrawList(wxPoint point);
299 
307  virtual void DrawBoundingBox(wxDC &WXUNUSED(dc), bool all = false);
308 
309  bool DrawThisCell(wxPoint point);
310  bool DrawThisCell(){return DrawThisCell(m_currentPoint);}
311 
318  void ForceBreakLine(bool force = true) { m_forceBreakLine = m_breakLine = force; }
319 
324  int GetHeight() const
325  { return m_height; }
326 
331  int GetWidth() const
332  { return m_width; }
333 
339  int GetCenter() const
340  { return m_center; }
341 
343  bool HasValidSize() const;
345  bool HasStaleSize() const;
347  bool HasValidPosition() const;
348 
358  int GetDrop() const
359  { return m_height - m_center; }
360 
365  { return m_type; }
366 
373  int GetMaxDrop() const;
374 
381  int GetCenterList() const;
382 
387  int GetHeightList() const;
388 
390  int GetFullWidth() const;
391 
397  int GetLineWidth() const;
398 
403  int GetCurrentX() const
404  { return m_currentPoint.x; }
405 
410  int GetCurrentY() const
411  { return m_currentPoint.y; }
412 
419  virtual wxRect GetRect(bool all = false) const;
420 
422  virtual bool NeedsRecalculation(AFontSize fontSize) const;
423 
424  virtual wxString GetDiffPart() const;
425 
433  virtual void Recalculate(AFontSize fontsize);
434 
439  void RecalculateList(AFontSize fontsize);
440 
442  void FontsChangedList();
443 
444  void ClearNeedsToRecalculateWidths() { m_recalculateWidths = false; }
445 
447  void ResetData();
448 
449  void ResetDataList();
450 
452  void ResetSize();
453 
455  void ResetCellListSizes();
456 
458  void ResetCellListSizesList();
459 
460  void SetZeroSize();
461 
463  void ResetSizeList();
464 
465  void SetBigSkip(bool skip) { m_bigSkip = skip; }
466  bool HasBigSkip() const { return m_bigSkip; }
467 
469  virtual void SetType(CellType type);
470 
471  TextStyle GetStyle() const
472  { return m_textStyle; }
473 
475  // cppcheck-suppress functionStatic
476  // cppcheck-suppress functionConst
477  void SetPen(double lineWidth = 1.0) const;
479  void SetBrush() const;
480  wxColour GetForegroundColor() const;
481 
483  void SetHighlight(bool highlight) { m_highlight = highlight; }
485  bool GetHighlight() const { return m_highlight; }
486 
487  virtual void SetExponentFlag()
488  {}
489 
490  virtual void SetValue(const wxString &WXUNUSED(text)) {}
491  virtual const wxString &GetValue() const;
492 
494  Cell *first() const;
495 
497  Cell *last() const;
498 
499  struct Range {
500  Cell *first, *last;
501  };
502 
506  Range GetCellsInRect(const wxRect &rect) const;
507 
511  Range GetListCellsInRect(const wxRect &rect) const;
512 
514  virtual Range GetInnerCellsInRect(const wxRect &rect) const;
515 
517  virtual bool IsOperator() const { return false; }
518 
520  bool IsCompound() const;
521 
522  virtual bool IsShortNum() const { return false; }
523 
525  GroupCell *GetGroup() const;
526 
529  {
530  public:
531  double x, y;
532  };
533 
535  virtual wxString ListToString() const;
536 
541  wxString VariablesAndFunctionsList() const;
543  virtual wxString ListToMatlab() const;
545  virtual wxString ListToTeX() const;
547  virtual wxString ListToXML() const;
548 
550  virtual wxString ListToMathML(bool startofline = false) const;
551 
553  virtual wxString ListToOMML(bool startofline = false) const;
554 
556  virtual wxString ListToRTF(bool startofline = false) const;
557 
559  virtual wxString ToString() const;
560 
566  virtual wxString ToRTF() const
567  { return wxEmptyString; }
568 
570  static wxString OMML2RTF(wxXmlNode *node);
571 
573  static wxString OMML2RTF(wxString ommltext);
574 
584  virtual wxString ToOMML() const;
586  virtual wxString ToMatlab() const;
588  virtual wxString ToTeX() const;
590  virtual wxString ToXML() const;
592  virtual wxString ToMathML() const;
593 
595  static wxString RTFescape(wxString, bool MarkDown = false);
596 
598  static wxString XMLescape(wxString);
599 
600  // cppcheck-suppress functionStatic
601  // cppcheck-suppress functionConst
602 
610  virtual void Unbreak();
611 
619  virtual void UnbreakList();
620 
621  Cell *GetPrevious() const { return m_previous; }
622 
624  Cell *GetNext() const { return m_next.get(); }
631  Cell *GetNextToDraw() const { return m_nextToDraw; }
632 
640  virtual void SetNextToDraw(Cell *next) { m_nextToDraw = next; }
641  template <typename T, typename Del,
642  typename std::enable_if<std::is_base_of<Cell, T>::value, bool>::type = true>
643  void SetNextToDraw(const std::unique_ptr<T, Del> &ptr) { SetNextToDraw(ptr.get()); }
644 
649  bool IsComment() const
650  {
651  return m_type == MC_TYPE_TEXT || m_type == MC_TYPE_SECTION ||
652  m_type == MC_TYPE_SUBSECTION || m_type == MC_TYPE_SUBSUBSECTION ||
653  m_type == MC_TYPE_HEADING5 || m_type == MC_TYPE_HEADING6 || m_type == MC_TYPE_TITLE;
654  }
655 
663  bool IsHidden() const { return m_isHidden; }
664 
665  virtual void Hide(bool hide = true) { m_isHidden = hide; }
666 
667  bool IsEditable(bool input = false) const
668  {
669  return (m_type == MC_TYPE_INPUT &&
670  m_previous && m_previous->m_type == MC_TYPE_MAIN_PROMPT)
671  || (!input && IsComment());
672  }
673 
675  virtual bool CanPopOut() const { return false; }
676 
681  virtual wxString GnuplotSource() const {return wxEmptyString;}
682 
684  virtual void ProcessEvent(wxKeyEvent &WXUNUSED(event))
685  {}
686 
691  virtual bool AddEnding()
692  { return false; }
693 
694  virtual void SelectPointText(wxPoint point);
695 
696  virtual void SelectRectText(wxPoint one, wxPoint two);
697 
698  virtual void PasteFromClipboard(bool primary = false);
699 
700  virtual bool CopyToClipboard() const
701  { return false; }
702 
703  virtual bool CutToClipboard()
704  { return false; }
705 
706  virtual void SelectAll()
707  {}
708 
709  virtual bool CanCopy() const
710  { return false; }
711 
712  virtual wxPoint PositionToPoint(int WXUNUSED(pos) = -1)
713  { return wxPoint(-1, -1); }
714 
715  virtual bool IsDirty() const
716  { return false; }
717 
718  virtual void SwitchCaretDisplay()
719  {}
720 
721  virtual void SetFocus(bool WXUNUSED(focus))
722  {}
723 
725  void SetForeground();
726 
727  virtual bool IsActive() const
728  { return false; }
729 
731  virtual void SetStyle(TextStyle style)
732  {
733  m_textStyle = style;
734  ResetData();
735  }
737  bool IsMath() const;
738 
740  virtual int GetImageBorderWidth() const { return 0; }
741 
743  void CopyCommonData(const Cell & cell);
744 
746  std::unique_ptr<Cell> CopyList(GroupCell *group) const;
747 
749  static std::unique_ptr<Cell> CopyList(GroupCell *group, const Cell *cell);
750 
752  void ClearToolTip();
754  void SetToolTip(wxString &&toolTip);
758  void SetToolTip(const wxString *tooltip);
760  void AddToolTip(const wxString &tip);
762  virtual void SetCurrentPoint(wxPoint point) { m_currentPoint = point; }
764  void SetCurrentPoint(int x, int y) { m_currentPoint = {x, y}; }
766  wxPoint GetCurrentPoint() const {return m_currentPoint;}
767 
774  bool IsBrokenIntoLines() const { return m_isBrokenIntoLines; }
775 
784  bool GetSuppressMultiplicationDot() const { return m_suppressMultiplicationDot; }
785  void SetSuppressMultiplicationDot(bool val) { m_suppressMultiplicationDot = val; }
787  bool GetHidableMultSign() const { return m_isHidableMultSign; }
788  void SetHidableMultSign(bool val) { m_isHidableMultSign = val; }
789 
800  virtual void SetAltCopyText(const wxString &text);
802  virtual const wxString &GetAltCopyText() const { return wxm::emptyString; }
803 
804 #if wxUSE_ACCESSIBILITY
805  CellAccessible *GetAccessible();
806 #endif
807 #if CELL_TEST
808  void MockBreakUp() { m_isBrokenIntoLines = 1; }
809 #endif
810 
811 protected:
812  std::unique_ptr<Cell> MakeVisiblyInvalidCell() const;
813 public:
814  static std::unique_ptr<Cell> MakeVisiblyInvalidCell(GroupCell *group, Configuration **config);
815 
816 protected:
817 //** Bases and internal members (16 bytes)
818 //**
819 // VTable *__vtable;
820 // Observed __observed;
821 
822 //** 8-byte objects (8 bytes)
823 //**
837  wxPoint m_currentPoint{-1, -1};
838 
839 //** 8/4-byte objects (40 + 8* bytes)
840 //**
841 private:
843  std::unique_ptr<Cell> m_next;
844 
846  Cell *m_previous = {};
847 
848 #if wxUSE_ACCESSIBILITY
849  std::unique_ptr<CellAccessible> m_accessible;
850 #endif
851 
852 public:
853  const wxString &GetLocalToolTip() const;
854 protected:
860 
861  Configuration **m_configuration;
862 
865  const wxString *m_toolTip /* initialized in the constructor */;
866 
867 //** 4-byte objects (28 bytes)
868 //**
869 protected:
871  int m_height = -1;
873  int m_width = -1;
874  int m_center = -1;
875 
876 private:
878  CachedInteger<int> m_fullWidth;
880  CachedInteger<int> m_lineWidth;
881  CachedInteger<int> m_maxCenter;
882  CachedInteger<int> m_maxDrop;
883 protected:
884 //** 2-byte objects (2 bytes)
885 //**
888 
889 //** 1-byte objects (2 bytes)
890 //**
891  CellType m_type = MC_TYPE_DEFAULT;
892  TextStyle m_textStyle = TS_DEFAULT;
893 
894 private:
895 //** Bitfield objects (2 bytes)
896 //**
897  void InitBitFields()
898  { // Keep the initialization order below same as the order
899  // of bit fields in this class!
900  m_ownsToolTip = false;
901  m_bigSkip = false;
902  m_isBrokenIntoLines = false;
903  m_isHidden = false;
904  m_isHidableMultSign = false;
905  m_suppressMultiplicationDot = false;
906  m_recalculateWidths = true;
907  m_breakLine = false;
908  m_forceBreakLine = false;
909  m_highlight = false;
910  }
911 
912  // In the boolean bit fields below, InitBitFields is an indication that
913  // the InitBitFields() method initializes a given field. It should be
914  // only added once such initialization is in place. It makes it easier
915  // to verify that all bit fields are initialized.
916 
918  bool m_ownsToolTip : 1 /* InitBitFields */;
919  bool m_bigSkip : 1 /* InitBitFields */;
920  bool m_isBrokenIntoLines : 1 /* InitBitFields */;
921  bool m_isHidden : 1 /* InitBitFields */;
922  bool m_isHidableMultSign : 1 /* InitBitFields */;
923  bool m_suppressMultiplicationDot : 1 /* InitBitFields */;
925  bool m_recalculateWidths : 1 /* InitBitFields */;
927  bool m_breakLine : 1 /* InitBitFields */;
928  bool m_forceBreakLine : 1 /* InitBitFields */;
929  bool m_highlight : 1 /* InitBitFields */;
930 
931 protected:
932  friend class InnerCellIterator;
934  virtual int GetInnerCellCount() const;
937  virtual Cell *GetInnerCell(int index) const;
938 
939  inline Worksheet *GetWorksheet() const;
940 
942  virtual void FontsChanged()
943  {
944  ResetSize();
945  ResetData();
946  }
947 
948  CellPointers *GetCellPointers() const;
949 
950  void InvalidateMaxDrop() { m_maxDrop.Invalidate(); }
951 
952 private:
953  void RecalcCenterListAndMaxDropCache();
954 };
955 
956 // The static cast here requires Cell to be defined
957 template <typename T>
958 template <typename PtrT, typename std::enable_if<std::is_pointer<PtrT>::value, bool>::type>
959 inline PtrT CellPtr<T>::CastAs() const noexcept { return dynamic_cast<PtrT>(static_cast<Cell*>(base_get())); }
960 
961 #if wxUSE_ACCESSIBILITY
962 class CellAccessible final : public wxAccessible
963 {
964 public:
965  explicit CellAccessible(Cell *const forCell) : m_cell(forCell) {}
966 
968  wxAccStatus GetParent (wxAccessible **parent) override;
970  wxAccStatus GetChildCount (int *childCount) override;
972  wxAccStatus GetChild (int childId, wxAccessible **child) override;
974  wxAccStatus HitTest (const wxPoint &pt,
975  int *childId, wxAccessible **childObject) override;
977  wxAccStatus GetDescription(int childId, wxString *description) override;
979  wxAccStatus GetDefaultAction(int childId, wxString *actionName) override;
981  wxAccStatus GetFocus (int *childId, wxAccessible **child) override;
983  wxAccStatus GetLocation (wxRect &rect, int elementId) override;
985  wxAccStatus GetValue (int childId, wxString *strValue) override;
986  wxAccStatus GetRole (int childId, wxAccRole *role) override;
987 private:
988  Cell *const m_cell;
989 };
990 #endif
991 
993 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type = true>
994 inline auto OnList(const C *cell) { return CellListAdapter<const C>(cell); }
995 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type = true>
996 inline auto OnList(C *cell) { return CellListAdapter<C>(cell); }
997 
999 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type = true>
1000 inline auto OnDrawList(const C *cell) { return CellDrawListAdapter<const C>(cell); }
1001 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type = true>
1002 inline auto OnDrawList(C *cell) { return CellDrawListAdapter<C>(cell); }
1003 
1005 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type>
1006 inline auto OnInner(const C *cell) { return InnerCellAdapter(const_cast<Cell *>(cell)); }
1007 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value, bool>::type>
1008 inline auto OnInner(C *cell) { return InnerCellAdapter(cell); }
1009 
1010 inline int InnerCellIterator::GetInnerCellCount(const Cell *cell) { return cell->GetInnerCellCount(); }
1011 inline Cell *InnerCellIterator::GetInnerCell(const Cell *cell, int index) { return cell->GetInnerCell(index); }
1012 
1013 #endif // MATHCELL_H
Cell::GetCurrentX
int GetCurrentX() const
Definition: Cell.h:403
Cell::GnuplotSource
virtual wxString GnuplotSource() const
Definition: Cell.h:681
CellPtr< GroupCell >
Observed
Definition: CellPtr.h:86
Cell::SetStyle
virtual void SetStyle(TextStyle style)
Sets the TextStyle of this cell.
Definition: Cell.h:731
Cell::GetHeight
int GetHeight() const
Definition: Cell.h:324
Cell::NeedsRecalculation
virtual bool NeedsRecalculation(AFontSize fontSize) const
True, if something that affects the cell size has changed.
Definition: Cell.cpp:219
Cell::GetSuppressMultiplicationDot
bool GetSuppressMultiplicationDot() const
Definition: Cell.h:784
MC_TYPE_ERROR
@ MC_TYPE_ERROR
An error output by maxima.
Definition: Cell.h:71
Cell::AddToolTip
void AddToolTip(const wxString &tip)
Add another tooltip to this cell.
Definition: Cell.cpp:366
Cell::ContainsPoint
bool ContainsPoint(wxPoint point) const
Definition: Cell.h:260
Cell::SetCurrentPoint
void SetCurrentPoint(int x, int y)
Tells this cell where it is placed on the worksheet.
Definition: Cell.h:764
Cell::GetCurrentY
int GetCurrentY() const
Definition: Cell.h:410
Cell::CellsInListRecursive
int CellsInListRecursive() const
How many cells does this cell contain?
Definition: Cell.cpp:180
Cell::ListToXML
virtual wxString ListToXML() const
Convert this list to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:914
Cell::SetAltCopyText
virtual void SetAltCopyText(const wxString &text)
Definition: Cell.cpp:381
Cell::RTFescape
static wxString RTFescape(wxString, bool MarkDown=false)
Escape a string for RTF.
Definition: Cell.cpp:769
MC_TYPE_GROUP
@ MC_TYPE_GROUP
A group cells that bundles several individual cells together.
Definition: Cell.h:82
TextCell
Definition: TextCell.h:36
Cell::GetHidableMultSign
bool GetHidableMultSign() const
Whether this is a hidable multiplication sign.
Definition: Cell.h:787
Cell::OnInner
friend auto OnInner(const C *cell)
Returns an iterable that goes over the inner cells of this cell.
Definition: Cell.h:1006
Cell::HasHardLineBreak
bool HasHardLineBreak() const
Does this cell begin with a manual linebreak?
Definition: Cell.h:234
Cell::ProcessEvent
virtual void ProcessEvent(wxKeyEvent &WXUNUSED(event))
Processes a key event.
Definition: Cell.h:684
CellPtr.h
TextStyle
TextStyle
Definition: TextStyle.h:307
MC_TYPE_INPUT
@ MC_TYPE_INPUT
A cell containing code.
Definition: Cell.h:69
CellTypeInfo::GetName
virtual const wxString & GetName() const =0
MC_TYPE_LABEL
@ MC_TYPE_LABEL
An output label generated by maxima.
Definition: Cell.h:68
Cell::GetInnerCell
virtual Cell * GetInnerCell(int index) const
Definition: Cell.cpp:1450
Cell::ClearCacheList
void ClearCacheList()
Definition: Cell.cpp:174
MC_TYPE_TITLE
@ MC_TYPE_TITLE
The title of the document.
Definition: Cell.h:79
Cell::SizeInMillimeters
For the bitmap export we sometimes want to know how big the result will be...
Definition: Cell.h:528
Cell::ResetData
void ResetData()
Mark all cached size information as "to be calculated".
Definition: Cell.cpp:1010
Cell::DrawList
void DrawList(wxPoint point)
Definition: Cell.cpp:387
Cell::VariablesAndFunctionsList
wxString VariablesAndFunctionsList() const
Definition: Cell.cpp:524
Cell::ListToRTF
virtual wxString ListToRTF(bool startofline=false) const
Convert this list to an RTF representation.
Definition: Cell.cpp:846
Cell::HasValidSize
bool HasValidSize() const
Is the size valid and not pending a recalculation?
Definition: Cell.cpp:437
Cell::~Cell
virtual ~Cell()
Delete this list of cells.
Definition: Cell.cpp:72
InnerCellIterator
Iterates the inner cells of a cell.
Definition: CellIterators.h:137
Cell::CopyCommonData
void CopyCommonData(const Cell &cell)
Copy common data (used when copying a cell)
Definition: Cell.cpp:140
Cell::ToXML
virtual wxString ToXML() const
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:631
Cell::GetLineWidth
int GetLineWidth() const
Definition: Cell.cpp:282
Cell::ListToString
virtual wxString ListToString() const
Returns the list's representation as a string.
Definition: Cell.cpp:542
Cell::GetAltCopyText
virtual const wxString & GetAltCopyText() const
Get the text set using SetAltCopyText - may be empty.
Definition: Cell.h:802
MC_TYPE_WARNING
@ MC_TYPE_WARNING
A warning output by maxima.
Definition: Cell.h:70
Cell::GetInnerCellCount
virtual int GetInnerCellCount() const
The number of inner cells - for use by the iterators.
Definition: Cell.cpp:1448
Cell::ResetCellListSizes
void ResetCellListSizes()
Mark the line and cell list widths and heights as "to be calculated".
Definition: Cell.cpp:1043
Cell::Unbreak
virtual void Unbreak()
Definition: Cell.cpp:1092
CellListAdapter
Definition: CellIterators.h:70
Cell::m_toolTip
const wxString * m_toolTip
Definition: Cell.h:865
Cell::ToMatlab
virtual wxString ToMatlab() const
Convert this cell to its Matlab representation.
Definition: Cell.cpp:575
Cell::m_fontSize_Scaled
AFontSize m_fontSize_Scaled
The font size is smaller in super- and subscripts.
Definition: Cell.h:887
Cell::SetType
virtual void SetType(CellType type)
Sets the text style according to the type.
Definition: Cell.cpp:81
Cell::ContainsRect
bool ContainsRect(const wxRect &sm, bool all=true) const
Definition: Cell.cpp:993
TextStyle.h
Cell::BreakLineHere
bool BreakLineHere() const
Are we allowed to break a line here?
Definition: Cell.h:231
Cell::SetPen
void SetPen(double lineWidth=1.0) const
Sets the drawing pen to the cell's default foreground color.
Definition: Cell.cpp:1134
Cell::DrawBoundingBox
virtual void DrawBoundingBox(wxDC &WXUNUSED(dc), bool all=false)
Definition: Cell.cpp:500
Cell::ToOMML
virtual wxString ToOMML() const
Definition: Cell.cpp:814
Cell::ForceBreakLine
void ForceBreakLine(bool force=true)
Definition: Cell.h:318
Cell::Copy
virtual std::unique_ptr< Cell > Copy(GroupCell *group) const =0
Cell::GetToolTip
virtual const wxString & GetToolTip(wxPoint point) const
Definition: Cell.cpp:45
Cell::CanPopOut
virtual bool CanPopOut() const
Can this cell be popped out interactively in gnuplot?
Definition: Cell.h:675
Cell::ListToTeX
virtual wxString ListToTeX() const
Convert this list to its LaTeX representation.
Definition: Cell.cpp:618
CellList
Definition: CellList.h:142
Cell::IsMath
bool IsMath() const
Is this cell possibly output of maxima?
Definition: Cell.cpp:1203
Cell::IsBrokenIntoLines
bool IsBrokenIntoLines() const
Definition: Cell.h:774
Cell::GetHighlight
bool GetHighlight() const
Is this cell highlighted (e.G. inside a maxima box)
Definition: Cell.h:485
Cell::ClearCache
virtual void ClearCache()
Definition: Cell.h:267
Cell::GetCenter
int GetCenter() const
Definition: Cell.h:339
Cell::ResetSizeList
void ResetSizeList()
Mark the cached height information of the whole list of cells as "to be calculated".
Definition: Cell.cpp:402
Cell::ListToOMML
virtual wxString ListToOMML(bool startofline=false) const
Convert this list to an OMML representation.
Definition: Cell.cpp:816
MC_TYPE_MAIN_PROMPT
@ MC_TYPE_MAIN_PROMPT
Input labels.
Definition: Cell.h:66
MC_TYPE_SLIDE
@ MC_TYPE_SLIDE
An animation created by the with_slider_* maxima commands.
Definition: Cell.h:81
Cell::HasStaleSize
bool HasStaleSize() const
Is the size valid, whether a recalculation is pending or not?
Definition: Cell.cpp:443
MC_TYPE_ASCIIMATHS
@ MC_TYPE_ASCIIMATHS
Equations displayed in 2D.
Definition: Cell.h:73
Cell::HasValidPosition
bool HasValidPosition() const
Is the position valid?
Definition: Cell.cpp:448
Cell::RecalculateList
void RecalculateList(AFontSize fontsize)
Definition: Cell.cpp:396
Cell::InUpdateRegion
bool InUpdateRegion() const
Is this cell inside the region that is currently drawn?
Definition: Cell.cpp:476
Cell::IsOperator
virtual bool IsOperator() const
Is this cell an operator?
Definition: Cell.h:517
Cell::Scale_Px
int Scale_Px(double px) const
Definition: Cell.h:173
Cell::GetType
CellType GetType() const
Definition: Cell.h:364
Cell::GetHeightList
int GetHeightList() const
Definition: Cell.cpp:260
Cell::CropToUpdateRegion
wxRect CropToUpdateRegion(wxRect rect) const
The part of the rectangle rect that is in the region that is currently drawn.
Definition: Cell.cpp:194
Cell::GetInnerCellsInRect
virtual Range GetInnerCellsInRect(const wxRect &rect) const
Select the cells inside this cell described by the rectangle rect.
Definition: Cell.cpp:978
Cell
Definition: Cell.h:139
Cell::IsComment
bool IsComment() const
Definition: Cell.h:649
Cell::DrawThisCell
bool DrawThisCell(wxPoint point)
Definition: Cell.cpp:417
MC_TYPE_TEXT
@ MC_TYPE_TEXT
Text that isn't passed to maxima.
Definition: Cell.h:72
Cell::BreakUpAndMark
void BreakUpAndMark()
Break up the internal cells of this cell, and mark it as broken up.
Definition: Cell.cpp:1083
Cell::GetNextToDraw
Cell * GetNextToDraw() const
Definition: Cell.h:631
MC_TYPE_HEADING5
@ MC_TYPE_HEADING5
A subsubsection name.
Definition: Cell.h:76
Cell::first
Cell * first() const
Get the first cell in this list of cells.
Definition: Cell.cpp:1058
Cell::GetDrop
int GetDrop() const
Definition: Cell.h:358
EditorCell
Definition: EditorCell.h:57
CachedInteger< int >
Cell::SetForeground
void SetForeground()
Sets the foreground color.
Definition: Cell.cpp:1166
Cell::m_nextToDraw
CellPtr< Cell > m_nextToDraw
Definition: Cell.h:859
Cell::GetNext
Cell * GetNext() const
Get the next cell in the list.
Definition: Cell.h:624
Cell::GetInfo
virtual const CellTypeInfo & GetInfo()=0
Returns the information about this cell's type.
Cell::m_group
CellPtr< GroupCell > m_group
Definition: Cell.h:856
CellPointers
Definition: CellPointers.h:44
Cell::GetGroup
GroupCell * GetGroup() const
Returns the group cell this cell belongs to.
Definition: Cell.cpp:212
Cell::Draw
virtual void Draw(wxPoint point)
Definition: Cell.cpp:305
Cell::GetImageBorderWidth
virtual int GetImageBorderWidth() const
0 for ordinary cells, 1 for slide shows and diagrams displayed with a 1-pixel border
Definition: Cell.h:740
MC_TYPE_SUBSECTION
@ MC_TYPE_SUBSECTION
A subsection name.
Definition: Cell.h:74
InnerCellAdapter
Definition: CellIterators.h:210
Cell::SetToolTip
void SetToolTip(wxString &&toolTip)
Set the tooltip to a given temporary string - the cell will move from it.
Definition: Cell.cpp:342
AFontSize
Definition: FontAttribs.h:97
Cell::GetWidth
int GetWidth() const
Definition: Cell.h:331
MC_TYPE_PROMPT
@ MC_TYPE_PROMPT
Maxima questions or lisp prompts.
Definition: Cell.h:67
Cell::SetNextToDraw
virtual void SetNextToDraw(Cell *next)
Definition: Cell.h:640
CellType
CellType
Definition: Cell.h:63
Cell::SoftLineBreak
bool SoftLineBreak(bool breakLine=true)
Do we want this cell to start with a linebreak?
Definition: Cell.h:223
Cell::m_height
int m_height
The height of this cell.
Definition: Cell.h:871
Cell::CopyList
std::unique_ptr< Cell > CopyList(GroupCell *group) const
Return a copy of the list of cells beginning with this one.
Definition: Cell.cpp:161
CachedValue.h
OnDrawList
auto OnDrawList(const C *cell)
Returns an iterable that goes over the cell draw list, starting with given, possibly null,...
Definition: Cell.h:1000
Cell::IsHidden
bool IsHidden() const
Definition: Cell.h:663
Cell::ToTeX
virtual wxString ToTeX() const
Convert this cell to its LaTeX representation.
Definition: Cell.cpp:613
Cell::OMML2RTF
static wxString OMML2RTF(wxXmlNode *node)
Converts an OMML tag to the corresponding RTF snippet.
Definition: Cell.cpp:700
Cell::m_width
int m_width
The width of this cell; is recalculated by RecalculateHeight.
Definition: Cell.h:873
Cell::Range
Definition: Cell.h:499
Cell::GetCenterList
int GetCenterList() const
Definition: Cell.cpp:226
Cell::m_currentPoint
wxPoint m_currentPoint
Definition: Cell.h:837
Configuration
Definition: Configuration.h:83
Cell::ListToMathML
virtual wxString ListToMathML(bool startofline=false) const
Convert this list to a MathML representation.
Definition: Cell.cpp:641
Cell::FontsChangedList
void FontsChangedList()
Tell a whole list of cells that their fonts have changed.
Definition: Cell.cpp:202
Cell::ResetCellListSizesList
void ResetCellListSizesList()
Mark the line and cell list widths and heights as "to be calculated".
Definition: Cell.cpp:1024
Cell::ClearToolTip
void ClearToolTip()
Remove this cell's tooltip.
Definition: Cell.cpp:334
Cell::AddEnding
virtual bool AddEnding()
Definition: Cell.h:691
CellDrawListAdapter
Definition: CellIterators.h:119
OnList
auto OnList(const C *cell)
Returns an iterable the goes over the cell list, starting with given, possibly null,...
Definition: Cell.h:994
Cell::SetCurrentPoint
virtual void SetCurrentPoint(wxPoint point)
Tells this cell where it is placed on the worksheet.
Definition: Cell.h:762
Cell::last
Cell * last() const
Get the last cell in this list of cells.
Definition: Cell.cpp:1068
MC_TYPE_IMAGE
@ MC_TYPE_IMAGE
An image.
Definition: Cell.h:80
Cell::UnbreakList
virtual void UnbreakList()
Definition: Cell.cpp:1109
Cell::SetHighlight
void SetHighlight(bool highlight)
Mark this cell as highlighted (e.G. being in a maxima box)
Definition: Cell.h:483
Worksheet
Definition: Worksheet.h:86
Cell::GetFullWidth
int GetFullWidth() const
How many pixels is this list of cells wide, if we don't break it into lines?
Definition: Cell.cpp:265
Cell::ResetSize
void ResetSize()
Mark the cached height and width information as "to be calculated".
Definition: Cell.cpp:1034
Cell::ToMathML
virtual wxString ToMathML() const
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:636
Cell::ListToMatlab
virtual wxString ListToMatlab() const
Convert this list to its LaTeX representation.
Definition: Cell.cpp:580
Cell::GetCellsInRect
Range GetCellsInRect(const wxRect &rect) const
Definition: Cell.cpp:956
Cell::GetRect
virtual wxRect GetRect(bool all=false) const
Definition: Cell.cpp:466
Cell::ToRTF
virtual wxString ToRTF() const
Definition: Cell.h:566
GroupCell
Definition: GroupCell.h:68
Cell::IsCompound
bool IsCompound() const
Do we have an operator in this line - draw () in frac...
Definition: Cell.cpp:509
Cell::GetMaxDrop
int GetMaxDrop() const
Definition: Cell.cpp:243
Cell::SetBrush
void SetBrush() const
Sets the fill brush to the cell's default foreground color.
Definition: Cell.cpp:1149
Cell::FontsChanged
virtual void FontsChanged()
To be called if the font has changed.
Definition: Cell.h:942
CellIterators.h
CellTypeInfo
A class that carries information about the type of a cell.
Definition: Cell.h:90
Cell::ToString
virtual wxString ToString() const
Returns the cell's representation as a string.
Definition: Cell.cpp:517
MC_TYPE_SUBSUBSECTION
@ MC_TYPE_SUBSUBSECTION
A subsubsection name.
Definition: Cell.h:75
OnInner
auto OnInner(const C *cell)
Returns an iterable that goes over the inner cells of this cell.
Definition: Cell.h:1006
MC_TYPE_SECTION
@ MC_TYPE_SECTION
A section name.
Definition: Cell.h:78
Cell::Recalculate
virtual void Recalculate(AFontSize fontsize)
Definition: Cell.cpp:408
Cell::XMLescape
static wxString XMLescape(wxString)
Escape a string for XML.
Definition: Cell.cpp:759
Cell::BreakUp
virtual bool BreakUp()
Definition: Cell.cpp:1078
Cell::GetCurrentPoint
wxPoint GetCurrentPoint() const
Where is this cell placed on the worksheet?
Definition: Cell.h:766
Cell::GetListCellsInRect
Range GetListCellsInRect(const wxRect &rect) const
Definition: Cell.cpp:964
MC_TYPE_HEADING6
@ MC_TYPE_HEADING6
A subsubsection name.
Definition: Cell.h:77