32#include "../precomp.h"
35#include "Configuration.h"
36#include "StringUtils.h"
40#if wxUSE_ACCESSIBILITY
56template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
58template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
87#if wxUSE_ACCESSIBILITY
149#if wxUSE_ACCESSIBILITY
150 friend class CellAccessible;
155 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
156 friend inline auto OnInner(
const C *cell);
157 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
158 friend inline auto OnInner(
C *cell);
164 void operator=(
const Cell&) =
delete;
188#if wxUSE_ACCESSIBILITY
193 wxAccStatus GetParent (
Cell ** parent)
const;
195 wxAccStatus GetChild(
int childId,
Cell **child)
const;
197 wxAccStatus HitTest (
const wxPoint &pt,
int *childId,
Cell **child);
200 virtual wxAccStatus GetName (
int childId, wxString *name)
const;
202 virtual wxAccStatus GetDescription(
int childId, wxString *description)
const;
204 virtual wxAccStatus GetFocus (
int *childId,
Cell **child)
const;
206 virtual wxAccStatus GetDefaultAction(
int childId, wxString *actionName)
const;
208 virtual wxAccStatus GetLocation (wxRect &rect,
int elementId);
210 virtual wxAccStatus
GetValue (
int childId, wxString *strValue)
const;
211 virtual wxAccStatus GetRole (
int childId, wxAccRole *role)
const;
213 virtual wxAccStatus GetState (
int childId,
long *state)
const;
224 virtual const wxString
GetToolTip(wxPoint point)
const;
233 virtual wxString
GetLinkAt(wxPoint point);
250 bool newBreak = breakLine || m_forceBreakLine;
251 if (m_breakLine != newBreak)
253 m_breakLine = newBreak;
254 InvalidateListCache();
284 int clientWidth,
int parent = -1)
const;
393 bool ContainsRect(
const wxRect &sm,
bool all =
true)
const;
424 int &WXUNUSED(decodeFailed))
const
437 int &decodeFailed)
const;
443 int &decodeFailed)
const;
457 virtual void Draw(wxDC *dc, wxDC *antialiassingDC);
490 if (m_forceBreakLine != force || m_breakLine != force)
492 m_forceBreakLine = m_breakLine = force;
493 InvalidateListCache();
498 wxString
GetUUID()
const {
return m_rareData ? m_rareData->uuid : wxString(); }
500 void SetUUID(
const wxString &uuid);
626 virtual wxRect
GetRect(
bool wholeList =
false)
const;
714 {
return m_textStyle; }
719 void SetPen(wxDC *dc,
double lineWidth = 1.0)
const;
732 wxColour GetForegroundColor()
const;
755 virtual void SetValue(
const wxString &WXUNUSED(text)) {}
757 virtual const wxString &
GetValue()
const;
758 virtual const wxString GetDisplayedString()
const {
return GetValue();}
819 virtual wxString
ListToMathML(
bool startofline =
false)
const;
822 virtual wxString
ListToOMML(
bool startofline =
false)
const;
825 virtual wxString
ListToRTF(
bool startofline =
false)
const;
836 {
return wxEmptyString; }
839 static wxString
OMML2RTF(wxXmlNode *node);
842 static wxString
OMML2RTF(wxString ommltext);
853 virtual wxString
ToOMML()
const;
857 virtual wxString
ToTeX()
const;
867 static wxString
TeXGroup(
const wxString &tex);
878 virtual wxString
ToXML()
const;
879 virtual wxString GetXMLFlags()
const;
884 static wxString
RTFescape(wxString,
bool MarkDown =
false);
968 virtual void Hide(
bool hide =
true) { m_isHidden = hide; }
1037 {
return wxDefaultPosition; }
1041 {
return wxDefaultPosition; }
1047 virtual void SwitchCaretDisplay()
1065 m_textStyle = style;
1085 void SetToolTip(
const wxString &tooltip)
const ;
1089 void SetToolTip(
const wxString *toolTip)
const;
1160 void SetSuppressMultiplicationDot(
bool val) { m_suppressMultiplicationDot = val; }
1163 void SetHidableMultSign(
bool val) { m_isHidableMultSign = val; }
1179#if wxUSE_ACCESSIBILITY
1180 CellAccessible *GetAccessible();
1183 void MockBreakUp() { m_isBrokenIntoLines = 1; }
1186 static wxString wxColor2HtmlString(wxColor col);
1188 std::unique_ptr<Cell> MakeVisiblyInvalidCell()
const;
1221 mutable std::atomic<std::int_fast32_t> m_cellCfgCnt_last = { -1 };
1231 mutable std::atomic<std::int_fast32_t> m_listCacheCfgCnt = { -1 };
1233 std::unique_ptr<Cell> m_next;
1236 Cell *m_previous = {};
1238#if wxUSE_ACCESSIBILITY
1239 std::unique_ptr<CellAccessible> m_accessible;
1243 const wxString &GetLocalToolTip()
const;
1317 void UpdateListCaches()
const;
1320 mutable bool m_ownsToolTip : 1 =
false;
1321 bool m_bigSkip : 1 =
false;
1322 mutable bool m_isBrokenIntoLines : 1 =
false;
1323 bool m_isHidden : 1 =
false;
1324 bool m_isHidableMultSign : 1 =
false;
1325 bool m_suppressMultiplicationDot : 1 =
false;
1327 mutable bool m_breakLine : 1 =
false;
1329 mutable bool m_atLineBreak : 1 =
false;
1339 struct RareCellData {
1343 std::map<wxString, wxString> extraAttributes;
1345 std::unique_ptr<RareCellData> m_rareData;
1347 RareCellData &RareData();
1349 mutable bool m_forceBreakLine : 1 =
false;
1350 bool m_highlight : 1 =
false;
1369 void InvalidateListCache()
const;
1373template <
typename T>
1374template <typename PtrT, typename std::enable_if<std::is_pointer<PtrT>::value,
bool>::type>
1375inline PtrT
CellPtr<T>::CastAs() const noexcept {
return dynamic_cast<PtrT
>(
static_cast<Cell*
>(base_get())); }
1377#if wxUSE_ACCESSIBILITY
1378class CellAccessible final :
public wxAccessible
1381 explicit CellAccessible(
Cell *
const forCell) : m_cell(forCell) {}
1384 wxAccStatus GetName (
int childId, wxString *name)
override;
1386 wxAccStatus GetParent (wxAccessible **parent)
override;
1388 wxAccStatus GetChildCount (
int *childCount)
override;
1390 wxAccStatus GetChild (
int childId, wxAccessible **child)
override;
1392 wxAccStatus HitTest (
const wxPoint &pt,
1393 int *childId, wxAccessible **child)
override;
1395 wxAccStatus GetDescription(
int childId, wxString *description)
override;
1397 wxAccStatus GetDefaultAction(
int childId, wxString *actionName)
override;
1399 wxAccStatus GetFocus (
int *childId, wxAccessible **child)
override;
1401 wxAccStatus GetLocation (wxRect &rect,
int elementId)
override;
1403 wxAccStatus GetValue (
int childId, wxString *strValue)
override;
1404 wxAccStatus GetRole (
int childId, wxAccRole *role)
override;
1406 wxAccStatus GetState (
int childId,
long *state)
override;
1413template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1415template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1419template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1421template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1425template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
1427template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
1430inline size_t InnerCellIterator::GetInnerCellCount(
const Cell *cell) {
return cell->
GetInnerCellCount(); }
1431inline Cell *InnerCellIterator::GetInnerCell(
const Cell *cell,
size_t index) {
return cell->
GetInnerCell(index); }
Declares "mostly read-only" wrappers around values that are expensive to compute and are thus cached.
Declares the various iterators useful with the Cell class.
Implementation of an observing weak Cell pointer.
auto OnList(const C *cell)
Returns an iterable the goes over the cell list, starting with given, possibly null,...
Definition: Cell.h:1414
std::ostream & operator<<(std::ostream &out, const CellType celltype)
Allow Standard c++ streams to print out our enum values as text.
Definition: Cell.cpp:2038
auto OnDrawList(const C *cell)
Returns an iterable that goes over the cell draw list, starting with given, possibly null,...
Definition: Cell.h:1420
CellType
The supported types of math cells.
Definition: Cell.h:64
@ MC_TYPE_WARNING
A warning output by maxima.
Definition: Cell.h:70
@ MC_TYPE_PROMPT
Maxima questions or lisp prompts.
Definition: Cell.h:67
@ MC_TYPE_SECTION
A section name.
Definition: Cell.h:78
@ MC_TYPE_ASCIIMATHS
Equations displayed in 2D.
Definition: Cell.h:73
@ MC_TYPE_LABEL
An output label generated by maxima.
Definition: Cell.h:68
@ MC_TYPE_GROUP
A group cells that bundles several individual cells together.
Definition: Cell.h:82
@ MC_TYPE_MAIN_PROMPT
Input labels.
Definition: Cell.h:66
@ MC_TYPE_SUBSECTION
A subsection name.
Definition: Cell.h:74
@ MC_TYPE_INPUT
A cell containing code.
Definition: Cell.h:69
@ MC_TYPE_HEADING5
A subsubsection name.
Definition: Cell.h:76
@ MC_TYPE_TITLE
The title of the document.
Definition: Cell.h:79
@ MC_TYPE_SLIDE
An animation created by the with_slider_* maxima commands.
Definition: Cell.h:81
@ MC_TYPE_SUBSUBSECTION
A subsubsection name.
Definition: Cell.h:75
@ MC_TYPE_HEADING6
A subsubsection name.
Definition: Cell.h:77
@ MC_TYPE_TEXT
Text that isn't passed to maxima.
Definition: Cell.h:72
@ MC_TYPE_IMAGE
An image.
Definition: Cell.h:80
@ MC_TYPE_ERROR
An error output by maxima.
Definition: Cell.h:71
auto OnInner(const C *cell)
Returns an iterable that goes over the inner cells of this cell.
Definition: Cell.h:1426
This file declares everything needed for the text style system used to style all the elements on the ...
TextStyle
All text styles known to wxMaxima.
Definition: TextStyle.h:230
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:99
Definition: diagrams_c.h:5
A cached integer value.
Definition: CachedValue.h:45
Definition: CellIterators.h:174
Definition: CellIterators.h:75
Definition: CellList.h:151
A weak non-owning pointer that becomes null whenever the observed object is destroyed.
Definition: CellPtr.h:539
A class that carries information about the type of a cell.
Definition: Cell.h:93
virtual const wxString & GetName() const =0
The name of the cell type, e.g.
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:148
bool ConfigChanged() const
Has the configuration changed since the last recalculation of this cell?
Definition: Cell.h:636
bool FontSizeMatchesExpectation() const
Does this cell's font size match what its owner last dictated?
Definition: Cell.cpp:584
virtual wxString ToMatlab() const
Convert this cell to its Matlab representation.
Definition: Cell.cpp:1008
virtual const wxString GetToolTip(wxPoint point) const
Returns the ToolTip this cell provides at a given point.
Definition: Cell.cpp:78
bool InUpdateRegion() const
Is this cell inside the region that is currently drawn?
Definition: Cell.cpp:920
virtual void DrawBoundingBox(wxDC &WXUNUSED(dc), bool all=false)
Draw a rectangle that marks this cell or this list of cells as selected.
Definition: Cell.cpp:948
void SetAtLineBreak(bool atLineBreak) const
Tell this cell whether it is directly before or after a soft line break.
Definition: Cell.cpp:778
bool IsBrokenIntoLines() const
Whether this cell is broken into two or more lines.
Definition: Cell.h:1149
void SetPen(wxDC *dc, double lineWidth=1.0) const
Sets the drawing pen to the cell's default foreground color.
Definition: Cell.cpp:1634
void CopyCommonData(const Cell &cell)
Copy common data (used when copying a cell)
Definition: Cell.cpp:214
virtual void PasteFromClipboard(bool primary=false)
Paste from the clipboard into this cell.
Definition: Cell.cpp:1406
bool IsHidden() const
Whether this cell is not to be drawn.
Definition: Cell.h:962
Range GetCellsInRect(const wxRect &rect) const
Returns the first and last cells within the given rectangle, recursing into the inner cells.
Definition: Cell.cpp:1441
virtual size_t GetInnerCellCount() const
The number of inner cells - for use by the iterators.
Definition: Cell.cpp:2029
void ResetSize_RecursivelyList() const
Mark all cached size information of this cell list as "to be calculated".
Definition: Cell.cpp:1496
virtual int GetImageBorderWidth() const
0 for ordinary cells, 1 for slide shows and diagrams displayed with a 1-pixel border
Definition: Cell.h:1071
virtual wxString ToOMML() const
Returns the cell's representation as OMML.
Definition: Cell.cpp:1319
void SetBigSkip(bool skip)
Tell this cell to cause an additional vertical space.
Definition: Cell.h:705
bool IsDrawnHidden() const
Is this cell drawn as empty space on the screen?
Definition: Cell.cpp:798
void TallyImageLoadFailures_Recursively(int &dataUnavailable, int &decodeFailed) const
Recursively visits this cell and everything nested inside it (including an image produced by the very...
Definition: Cell.cpp:1501
bool HasBigSkip() const
Does this cell come with an additional vertical space.
Definition: Cell.h:707
virtual void UnbreakList() const
Unbreak this line.
Definition: Cell.cpp:1589
wxRect CropToUpdateRegion(wxRect rect) const
The part of the rectangle rect that is in the region that is currently drawn.
Definition: Cell.cpp:275
void SoftLineBreak(bool breakLine=true) const
Do we want this cell to start with a linebreak?
Definition: Cell.h:248
CellPtr< GroupCell > m_group
The GroupCell this list of cells belongs to.
Definition: Cell.h:1246
virtual wxString ListToMatlab() const
Convert this list to its LaTeX representation.
Definition: Cell.cpp:1010
virtual wxString ListToOMML(bool startofline=false) const
Convert this list to an OMML representation.
Definition: Cell.cpp:1321
GroupCell * GetGroup() const
Returns the group cell this cell belongs to.
Definition: Cell.cpp:290
bool HasRareCellData() const
Whether this cell carries a UUID or unknown XML attributes.
Definition: Cell.h:508
virtual bool IsActive() const
Is this editor cell focused?
Definition: Cell.h:1058
Configuration * GetConfiguration()
Which configuration object is responsible for this cell?
Definition: Cell.h:449
virtual wxString ListToString() const
Returns this cell list's representation as a string.
Definition: Cell.cpp:978
void BreakUpAndMark() const
Break up the internal cells of this cell, and mark it as broken up.
Definition: Cell.cpp:1567
void ForceBreakLine(bool force=true) const
Insert (or remove) a forced linebreak at the beginning of this cell.
Definition: Cell.h:488
virtual wxRect GetRect(bool wholeList=false) const
Get the smallest rectangle this cell fits in.
Definition: Cell.cpp:911
void AddExtraAttribute(const wxString &name, const wxString &value)
Adds an extra XML attribute to this cell.
Definition: Cell.cpp:2088
virtual wxCoord GetHeightList() const
Returns the total height of this line.
Definition: Cell.cpp:407
virtual void FontsChanged() const
To be called if the font has changed.
Definition: Cell.h:1361
virtual wxCoord GetCenterList() const
Returns the maximum distance between top and center of this line.
Definition: Cell.cpp:397
AFontSize m_fontSize_expected
The font size this cell's owner last dictated (via RecalculateTracked()).
Definition: Cell.h:1298
void ClearToolTip()
Remove this cell's tooltip.
Definition: Cell.cpp:474
wxString GetUUID() const
Returns the UUID of this cell.
Definition: Cell.h:498
virtual wxString GetLinkAt(wxPoint point)
The address of the link drawn at the screen coordinate point, if any (GH #2396).
Definition: Cell.cpp:92
wxCoord GetHeight() const
Get the height of this cell.
Definition: Cell.cpp:298
Cell * GetNext() const
Get the next cell in the list.
Definition: Cell.h:914
virtual void SelectAll()
Select all editable text of this cell.
Definition: Cell.h:1028
virtual Cell * GetBrokenCell(size_t index) const
Retrieve a piece of this cell's broken (linear/1D) display; see GetBrokenCellCount().
Definition: Cell.h:940
bool HasValidPosition() const
Has this cell been given a position yet? A negative one counts, too.
Definition: Cell.cpp:648
virtual void Unbreak() const
Undo breaking this cell into multiple lines.
Definition: Cell.cpp:1577
int GetLineIndent() const
If this were the beginning of a line: How far do we need to indent it?
Definition: Cell.cpp:671
void SetCurrentPointList(wxPoint point)
Helper to position a horizontal list of cells.
Definition: Cell.cpp:536
virtual void SetValue(const wxString &WXUNUSED(text))
Allows to change the text a TextCell contains.
Definition: Cell.h:755
wxCoord Scale_Px(double px) const
Scale font sizes and line widths according to the zoom factor.
Definition: Cell.h:181
CachedInteger< wxCoord > m_cachedLineWidth
Cache for GetLineWidth(): the width of only the first display line of the list starting at this cell ...
Definition: Cell.h:1284
virtual void TallyImageLoadFailures(int &WXUNUSED(dataUnavailable), int &WXUNUSED(decodeFailed)) const
Blocks until this cell's own image (if any) has finished loading, then adds 1 to dataUnavailable or d...
Definition: Cell.h:423
bool ContainsPoint(wxPoint point) const
Is a given point inside this cell?
Definition: Cell.h:399
virtual bool IsShortNum() const
True if this cell represents a short number.
Definition: Cell.h:791
CellType GetType() const
Returns the type of this cell.
Definition: Cell.h:563
void SetTextColor(wxDC *dc)
Sets the text color.
Definition: Cell.cpp:1649
virtual bool CanCopy() const
Select Can we copy the editable text of this cell?
Definition: Cell.h:1032
virtual wxString ListToMathML(bool startofline=false) const
Convert this list to a MathML representation.
Definition: Cell.cpp:1136
virtual wxString ListToTeX() const
Convert this list to its LaTeX representation.
Definition: Cell.cpp:1104
Cell * GetPrevious() const
Returns a pointer to the previous cell in the current cell list.
Definition: Cell.h:911
virtual const wxString & GetAltCopyText() const
Get the text set using SetAltCopyText - may be empty.
Definition: Cell.h:1177
bool GetHidableMultSign() const
Whether this is a hidable multiplication sign.
Definition: Cell.h:1162
bool HasHardLineBreak() const
Does this cell begin with a manual linebreak?
Definition: Cell.h:320
unsigned long CellsInListRecursive() const
How many cells does this cell contain?
Definition: Cell.cpp:263
virtual bool FirstLineOnlyEditor() const
True, if this GroupCell is folded and its editor shows only its first line.
Definition: Cell.cpp:196
bool IsAtLineBreak() const
Is this cell directly before or after a line break BreakLines_List() added?
Definition: Cell.h:337
virtual wxString ToString() const
Returns the cell's representation as a string.
Definition: Cell.cpp:962
void SetConfigurationList(Configuration *config)
Tell this cell list to use the configuration object config.
Definition: Cell.cpp:660
void AddToolTip(const wxString &tip)
Add another tooltip to this cell.
Definition: Cell.cpp:501
Cell * last() const
Get the last cell in this list of cells.
Definition: Cell.cpp:1556
virtual void ClearCache()
Clears memory from cached items automatically regenerated when the cell is drawn.
Definition: Cell.h:406
bool GetSuppressMultiplicationDot() const
Do we want to begin this cell with a center dot if it is part of a product?
Definition: Cell.h:1159
virtual wxString ListToRTF(bool startofline=false) const
Convert this list to an RTF representation.
Definition: Cell.cpp:1350
virtual void SetIsExponent()
Tell this cell to be an exponent.
Definition: Cell.cpp:526
bool GetHighlight() const
Is this cell highlighted (e.G. inside a maxima box)
Definition: Cell.h:737
static wxString RTFescape(wxString, bool MarkDown=false)
Escape a string for RTF.
Definition: Cell.cpp:1273
bool HasStaleSize() const
Is the size valid, whether a recalculation is pending or not?
Definition: Cell.cpp:644
void SetHighlight(bool highlight)
Mark this cell as highlighted (e.G. being in a maxima box)
Definition: Cell.h:735
bool HasValidSize() const
Is the size valid and not pending a recalculation?
Definition: Cell.cpp:640
virtual size_t GetBrokenCellCount() const
The number of pieces this cell is displayed as once it IsBrokenIntoLines(), and in what order – see G...
Definition: Cell.h:938
bool IsEditable(bool input=false) const
Is this cell editable?
Definition: Cell.h:974
wxCoord GetCurrentY() const
Get the y position of the top left of this cell.
Definition: Cell.h:617
virtual void SetIsExponentList()
Tell this list of cells to be an exponent.
Definition: Cell.cpp:520
virtual wxString ListToXML() const
Convert this list to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:1408
bool BreakLineHere() const
Are we allowed to break a line here?
Definition: Cell.h:317
void ResetSizeList() const
Mark the cached height information of the whole list of cells as "to be calculated".
Definition: Cell.cpp:599
virtual wxString GetDiffPart() const
Get the part for diff tag support.
Definition: Cell.cpp:1433
Range GetListCellsInRect(const wxRect &rect) const
Returns the first and last cells within the given rectangle, without recursing into the inner cells.
Definition: Cell.cpp:1448
static wxString TeXGroup(const wxString &tex)
Makes a piece of LaTeX usable as the base or the argument of ^ or _.
Definition: Cell.cpp:1043
wxCoord GetCenter() const
Get the distance between the top and the center of this cell.
Definition: Cell.cpp:318
CachedInteger< wxCoord > m_cachedMaxDrop
Cache for GetMaxDrop(): the largest drop (height below the center) of the cells on the first display ...
Definition: Cell.h:1278
void SetCurrentPoint(int x, int y) const
Sets the position for the cell and convenience overload.
Definition: Cell.h:1119
void BreakLines_List() const
Break lines in this list of cells.
Definition: Cell.cpp:681
wxPoint m_currentPoint
The point in the work sheet at which this cell begins.
Definition: Cell.h:1213
AFontSize m_fontSize
The unscaled font size.
Definition: Cell.h:1291
bool DrawThisCell()
Is this cell currently visible in the window?
Definition: Cell.cpp:626
void ClearCacheList()
Clears the cache of the whole list of cells starting with this one.
Definition: Cell.cpp:258
virtual void Hide(bool hide=true)
Hide this cell. See IsHidden() for details.
Definition: Cell.h:968
virtual void SelectPointText(wxPoint point)
Select the text at point.
Definition: Cell.cpp:1402
void DrawList(wxDC *dc, wxDC *adc)
Helper to draw a list of cells.
Definition: Cell.cpp:550
virtual wxString ToXML() const
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:1117
static bool TeXNeedsGrowingDelimiters(const wxString &tex)
Whether delimiters around this LaTeX need to grow with their contents.
Definition: Cell.cpp:1094
void CollectWideCells(std::vector< WideCell > &wideCells, int clientWidth, int parent=-1) const
Recursively collect all cells that are too wide to fit the line.
Definition: Cell.cpp:871
void SetUUID(const wxString &uuid)
Sets the UUID of this cell.
Definition: Cell.cpp:2092
virtual void SetAltCopyText(const wxString &text)
What should end up if placing this cell on the clipboard?
Definition: Cell.cpp:513
virtual void SelectRectText(wxPoint one, wxPoint two)
Select the text between the two points.
Definition: Cell.cpp:1404
virtual wxString ToMathML() const
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:1134
CachedInteger< wxCoord > m_height
The height of this cell.
Definition: Cell.h:1262
bool ContainsRect(const wxRect &sm, bool all=true) const
Is a part of this cell inside a certain rectangle?
Definition: Cell.cpp:1473
wxCoord SumOfWidths() const
How many pixels is this list of cells wide, if we don't break it into lines?
Definition: Cell.cpp:409
wxString VariablesAndFunctionsList() const
Returns all variable and function names used inside this list of cells.
Definition: Cell.cpp:966
virtual ~Cell()
Delete this list of cells.
Definition: Cell.cpp:120
AFontSize Scale_Px(AFontSize size) const
Scale font sizes and line widths according to the zoom factor.
Definition: Cell.h:186
virtual bool IsTextContinuation() const
Does this cell continue the line of text the cell before it holds?
Definition: Cell.h:328
virtual void SetStyle(TextStyle style)
Sets the TextStyle of this cell.
Definition: Cell.h:1062
virtual const CellTypeInfo & GetInfo()=0
Returns the information about this cell's type.
virtual std::unique_ptr< Cell > Copy(GroupCell *group) const =0
Create a copy of this cell.
void ScheduleRecalculation() const
Cause this cell to be recalculated the next time.
Definition: Cell.h:634
wxCoord GetLineWidth() const
How many pixels is the current line of this list of cells wide?
Definition: Cell.cpp:416
virtual wxPoint PositionToPoint()
Locates the cursor in the editable text of this cell.
Definition: Cell.h:1040
void SetToolTip(const wxString &tooltip) const
Set the tooltip to a given string.
Definition: Cell.cpp:481
virtual void SetConfiguration(Configuration *config)
Tell this cell to use the configuration object config.
Definition: Cell.cpp:665
virtual wxString GnuplotSource() const
Retrieve the gnuplot source data for this image.
Definition: Cell.h:988
virtual wxCoord GetMaxDrop() const
Returns the maximum distance between center and bottom of this line.
Definition: Cell.cpp:402
static wxString XMLescape(wxString)
Escape a string for XML.
Definition: Cell.cpp:1254
virtual void Draw(wxDC *dc, wxDC *antialiassingDC)
Pass 3 (Paint): Renders the cell using pre-calculated coordinates.
Definition: Cell.cpp:432
virtual Cell * GetInnerCell(size_t index) const
Retrieve an inner cell with given index which must be less than GetInnerCellCount.
Definition: Cell.cpp:2031
virtual const wxString & GetValue() const
Gets the text this text cell contains.
Definition: Cell.cpp:1647
Configuration * m_configuration
A pointer to the configuration responsible for this worksheet.
Definition: Cell.h:1249
int GetWidth() const
Get the width of this cell.
Definition: Cell.cpp:308
virtual wxString ToTeX() const
Convert this cell to its LaTeX representation.
Definition: Cell.cpp:1041
void ResetSize() const
Mark the cached height and width information as "to be calculated".
Definition: Cell.cpp:1515
void GenerateUUID()
Generates a new UUID for this cell.
Definition: Cell.cpp:2064
wxPoint GetCurrentPoint() const
Returns the pre-calculated worksheet position of the cell.
Definition: Cell.h:1140
virtual void SetFocus(bool WXUNUSED(focus))
Focus this editor cell.
Definition: Cell.h:1051
wxString GetExtraXMLAttributes() const
Returns a string containing all extra XML attributes.
Definition: Cell.cpp:2075
DocumentCellPointers * GetDocumentCellPointers() const
The document-model half of the cell-pointer registry this cell uses.
Definition: Cell.cpp:70
virtual void ProcessEvent(wxKeyEvent &WXUNUSED(event))
Processes a key event.
Definition: Cell.h:991
void SetCurrentPointDrawList(wxPoint point)
Helper to position a list of cells using the draw-list logic.
Definition: Cell.cpp:543
virtual void SetCurrentPoint(wxPoint point) const
Pass 2: Arrangement.
Definition: Cell.cpp:532
void TallyImageLoadFailures_RecursivelyList(int &dataUnavailable, int &decodeFailed) const
Same as TallyImageLoadFailures_Recursively(), but for the whole list of cells starting with this one.
Definition: Cell.cpp:1509
wxCoord GetCurrentX() const
Get the x position of the top left of this cell.
Definition: Cell.h:610
virtual wxCoord GetWidthAtLineBreak() const
The width this cell would have if it were at a line break.
Definition: Cell.h:366
bool IsComment() const
Determine if this cell contains text that isn't code.
Definition: Cell.h:946
bool BreakUpCells() const
Cell list: Convert 2d math objects bigger than the screen width into linear form.
Definition: Cell.cpp:802
static wxString OMML2RTF(wxXmlNode *node)
Converts an OMML tag to the corresponding RTF snippet.
Definition: Cell.cpp:1203
bool UnBreakUpCells() const
Convert all maths objects in this call list into their 2D form.
Definition: Cell.cpp:898
virtual void SetType(CellType type)
Sets the text style according to the type.
Definition: Cell.cpp:128
AFontSize m_fontSize_Scaled
The font size is smaller in super- and subscripts.
Definition: Cell.h:1289
virtual Range GetInnerCellsInRect(const wxRect &rect) const
Select the cells inside this cell described by the rectangle rect.
Definition: Cell.cpp:1460
CachedInteger< wxCoord > m_width
The width of this cell; is recalculated by RecalculateHeight.
Definition: Cell.h:1266
ViewCellPointers * GetViewCellPointers() const
The transient view-state half of the cell-pointer registry this cell uses.
Definition: Cell.cpp:74
virtual bool BreakUp() const
Try to split this command into lines to make it fit on the screen.
Definition: Cell.cpp:1565
bool IsCompound() const
Do we have an operator in this line - draw () in frac...
Definition: Cell.cpp:955
wxBitmap BitmapFromSVG(wxString svgData, wxSize size)
Renders a bitmap from svgData at the requested size.
Definition: Cell.cpp:184
void ResetSize_Recursively() const
Mark all cached size information as "to be calculated".
Definition: Cell.cpp:1488
CachedInteger< wxCoord > m_cachedCenterList
Cache for GetCenterList(): the largest center (height above the center) of the cells on the first dis...
Definition: Cell.h:1281
std::unique_ptr< Cell > CopyList(GroupCell *group) const
Return a copy of the list of cells beginning with this one.
Definition: Cell.cpp:238
virtual bool IsDirty() const
Is this cell marked as "from an old maxima run"?
Definition: Cell.h:1044
friend auto OnInner(const C *cell)
Returns an iterable that goes over the inner cells of this cell.
Definition: Cell.h:1426
virtual bool CutToClipboard()
Cut this cell's editable contents to the clipboard.
Definition: Cell.h:1024
virtual bool IsOperator() const
Is this cell an operator?
Definition: Cell.h:785
bool IsMath() const
Is this cell possibly output of maxima?
Definition: Cell.cpp:1678
virtual bool CanPopOut() const
Can this cell be popped out interactively in gnuplot?
Definition: Cell.h:982
wxCoord GetDrop() const
Get the distance between the center and the bottom of this cell.
Definition: Cell.h:557
CachedInteger< wxCoord > m_center
The distance between the top and the insertion point of this cell.
Definition: Cell.h:1272
virtual void Recalculate(AFontSize fontsize) const
Recalculate the size of the cell and the difference between top and center.
Definition: Cell.cpp:608
void FontsChangedList()
Tell a whole list of cells that their fonts have changed.
Definition: Cell.cpp:282
bool NeedsRecalculation() const
True, if something that affects the cell size has changed.
Definition: Cell.h:631
virtual bool AddEnding()
Add a semicolon to a code cell, if needed.
Definition: Cell.h:998
const wxString * m_toolTip
This tooltip is owned by us when m_ownsToolTip is true. Otherwise, it points to a "static" string.
Definition: Cell.h:1253
virtual bool CopyToClipboard() const
Copy this cell's editable contents to the clipboard.
Definition: Cell.h:1018
void SetBrush(wxDC *dc) const
Sets the fill brush to the cell's default foreground color.
Definition: Cell.cpp:1642
bool RecalculateTracked(AFontSize fontsize) const
Recalculate this cell at the font size its owner dictates.
Definition: Cell.cpp:566
bool RecalculateList(AFontSize fontsize) const
Recalculate both width and height of this list of cells.
Definition: Cell.cpp:556
const TextStyle & GetTextStyle() const
Get the text style.
Definition: Cell.h:713
Cell * first() const
Get the first cell in this list of cells.
Definition: Cell.cpp:1547
bool IsHiddenMultSign() const
Is this a multiplication sign the user has chosen to hide?
Definition: Cell.cpp:793
void DrawAngleBracketsAround(wxDC *dc, wxDC *antialiassingDC, Cell *open, Cell *close, const Cell *contents) const
Draws the angle brackets of a matrix power (A^⟨n⟩) around its exponent.
Definition: Cell.cpp:1605
virtual wxString ToRTF() const
Returns the cell's representation as RTF.
Definition: Cell.h:835
virtual wxPoint PositionToPoint(size_t WXUNUSED(pos))
Locates a char in the editable text of this cell.
Definition: Cell.h:1036
The configuration storage for the current worksheet.
Definition: Configuration.h:102
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1621
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1311
The document-model half of the cell-pointer registry.
Definition: CellPointers.h:54
This class defines what the user sees as input cell.
Definition: EditorCell.h:67
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
Definition: CellIterators.h:268
Iterates the inner cells of a cell.
Definition: CellIterators.h:192
Objects deriving from this class can be observed by the CellPtr.
Definition: CellPtr.h:97
A Text cell.
Definition: TextCell.h:40
The view/interaction half of the cell-pointer registry.
Definition: CellPointers.h:341
A struct that allows to specify a region of a cell list.
Definition: Cell.h:767
For the bitmap export we sometimes want to know how big the result will be...
Definition: Cell.h:798
A cell CollectWideCells() found too wide, and where it was found.
Definition: Cell.h:265
int parent
Index (in the same vector) of the wide cell this one was found in, or -1 for a cell of the draw list ...
Definition: Cell.h:269
int open(const char *, int)
Opens a file descriptor.
int close(int)
Closes the file descriptor fd.