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
143#if wxUSE_ACCESSIBILITY
144 friend class CellAccessible;
149 void operator=(
const Cell&) =
delete;
153 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
154 friend inline auto OnInner(
const C *cell);
155 template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
156 friend inline auto OnInner(
C *cell);
183#if wxUSE_ACCESSIBILITY
188 wxAccStatus GetParent (
Cell ** parent)
const;
190 wxAccStatus GetChild(
int childId,
Cell **child)
const;
192 wxAccStatus HitTest (
const wxPoint &pt,
int *childId,
Cell **child);
195 virtual wxAccStatus GetDescription(
int childId, wxString *description)
const;
197 virtual wxAccStatus GetFocus (
int *childId,
Cell **child)
const;
199 virtual wxAccStatus GetDefaultAction(
int childId, wxString *actionName)
const;
201 virtual wxAccStatus GetLocation (wxRect &rect,
int elementId);
203 virtual wxAccStatus
GetValue (
int childId, wxString *strValue)
const;
204 virtual wxAccStatus GetRole (
int childId, wxAccRole *role)
const;
215 virtual const wxString
GetToolTip(wxPoint point)
const;
232 bool newBreak = breakLine || m_forceBreakLine;
233 if (m_breakLine != newBreak)
235 m_breakLine = newBreak;
236 InvalidateListCache();
252 int clientWidth)
const;
315 bool ContainsRect(
const wxRect &sm,
bool all =
true)
const;
349 virtual void Draw(wxDC *dc, wxDC *antialiassingDC);
382 if (m_forceBreakLine != force || m_breakLine != force)
384 m_forceBreakLine = m_breakLine = force;
385 InvalidateListCache();
504 virtual wxRect
GetRect(
bool wholeList =
false)
const;
563 {
return m_textStyle; }
568 void SetPen(wxDC *dc,
double lineWidth = 1.0)
const;
571 wxColour GetForegroundColor()
const;
594 virtual void SetValue(
const wxString &WXUNUSED(text)) {}
596 virtual const wxString &
GetValue()
const;
597 virtual const wxString GetDisplayedString()
const {
return GetValue();}
658 virtual wxString
ListToMathML(
bool startofline =
false)
const;
661 virtual wxString
ListToOMML(
bool startofline =
false)
const;
664 virtual wxString
ListToRTF(
bool startofline =
false)
const;
675 {
return wxEmptyString; }
678 static wxString
OMML2RTF(wxXmlNode *node);
681 static wxString
OMML2RTF(wxString ommltext);
692 virtual wxString
ToOMML()
const;
696 virtual wxString
ToTeX()
const;
698 virtual wxString
ToXML()
const;
699 virtual wxString GetXMLFlags()
const;
704 static wxString
RTFescape(wxString,
bool MarkDown =
false);
751 template <
typename T,
typename Del,
752 typename std::enable_if<std::is_base_of<Cell, T>::value,
bool>::type =
true>
788 virtual void Hide(
bool hide =
true) { m_isHidden = hide; }
857 {
return wxDefaultPosition; }
861 {
return wxDefaultPosition; }
867 virtual void SwitchCaretDisplay()
905 void SetToolTip(
const wxString &tooltip)
const ;
909 void SetToolTip(
const wxString *toolTip)
const;
980 void SetSuppressMultiplicationDot(
bool val) { m_suppressMultiplicationDot = val; }
983 void SetHidableMultSign(
bool val) { m_isHidableMultSign = val; }
999#if wxUSE_ACCESSIBILITY
1000 CellAccessible *GetAccessible();
1003 void MockBreakUp() { m_isBrokenIntoLines = 1; }
1006 static wxString wxColor2HtmlString(wxColor col);
1008 std::unique_ptr<Cell> MakeVisiblyInvalidCell()
const;
1041 mutable std::atomic<std::int_fast32_t> m_cellCfgCnt_last = { -1 };
1043 std::unique_ptr<Cell> m_next;
1046 Cell *m_previous = {};
1048#if wxUSE_ACCESSIBILITY
1049 std::unique_ptr<CellAccessible> m_accessible;
1053 const wxString &GetLocalToolTip()
const;
1108 void InitBitFields_Cell()
1111 m_ownsToolTip =
false;
1113 m_isBrokenIntoLines =
false;
1115 m_isHidableMultSign =
false;
1116 m_suppressMultiplicationDot =
false;
1117 m_breakLine =
false;
1118 m_forceBreakLine =
false;
1119 m_highlight =
false;
1122 void UpdateListCaches()
const;
1130 mutable bool m_ownsToolTip : 1 ;
1131 bool m_bigSkip : 1 ;
1132 mutable bool m_isBrokenIntoLines : 1 ;
1133 bool m_isHidden : 1 ;
1134 bool m_isHidableMultSign : 1 ;
1135 bool m_suppressMultiplicationDot : 1 ;
1137 mutable bool m_breakLine : 1 ;
1144 mutable bool m_forceBreakLine : 1 ;
1145 bool m_highlight : 1 ;
1163 void InvalidateListCache()
const;
1167template <
typename T>
1168template <typename PtrT, typename std::enable_if<std::is_pointer<PtrT>::value,
bool>::type>
1169inline PtrT
CellPtr<T>::CastAs() const noexcept {
return dynamic_cast<PtrT
>(
static_cast<Cell*
>(base_get())); }
1171#if wxUSE_ACCESSIBILITY
1172class CellAccessible final :
public wxAccessible
1175 explicit CellAccessible(
Cell *
const forCell) : m_cell(forCell) {}
1178 wxAccStatus GetParent (wxAccessible **parent)
override;
1180 wxAccStatus GetChildCount (
int *childCount)
override;
1182 wxAccStatus GetChild (
int childId, wxAccessible **child)
override;
1184 wxAccStatus HitTest (
const wxPoint &pt,
1185 int *childId, wxAccessible **child)
override;
1187 wxAccStatus GetDescription(
int childId, wxString *description)
override;
1189 wxAccStatus GetDefaultAction(
int childId, wxString *actionName)
override;
1191 wxAccStatus GetFocus (
int *childId, wxAccessible **child)
override;
1193 wxAccStatus GetLocation (wxRect &rect,
int elementId)
override;
1195 wxAccStatus GetValue (
int childId, wxString *strValue)
override;
1196 wxAccStatus GetRole (
int childId, wxAccRole *role)
override;
1203template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1205template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1209template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1211template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type =
true>
1215template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
1217template <typename C, typename std::enable_if<std::is_base_of<Cell, C>::value,
bool>::type>
1220inline size_t InnerCellIterator::GetInnerCellCount(
const Cell *cell) {
return cell->
GetInnerCellCount(); }
1221inline 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:1204
std::ostream & operator<<(std::ostream &out, const CellType celltype)
Allow Standard c++ streams to print out our enum values as text.
Definition: Cell.cpp:1665
auto OnDrawList(const C *cell)
Returns an iterable that goes over the cell draw list, starting with given, possibly null,...
Definition: Cell.h:1210
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:1216
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
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:97
Definition: diagrams_c.h:5
A cached integer value.
Definition: CachedValue.h:45
Definition: CellIterators.h:133
Definition: CellIterators.h:77
Definition: CellList.h:151
The storage for pointers to cells.
Definition: CellPointers.h:45
A weak non-owning pointer that becomes null whenever the observed object is destroyed.
Definition: CellPtr.h:480
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:142
bool ConfigChanged() const
Has the configuration changed since the last recalculation of this cell?
Definition: Cell.h:514
virtual wxString ToMatlab() const
Convert this cell to its Matlab representation.
Definition: Cell.cpp:809
virtual const wxString GetToolTip(wxPoint point) const
Returns the ToolTip this cell provides at a given point.
Definition: Cell.cpp:71
bool InUpdateRegion() const
Is this cell inside the region that is currently drawn?
Definition: Cell.cpp:721
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:749
std::map< wxString, wxString > m_extraAttributes
Extra XML attributes we don't know yet.
Definition: Cell.h:1142
bool IsBrokenIntoLines() const
Whether this cell is broken into two or more lines.
Definition: Cell.h:969
void SetPen(wxDC *dc, double lineWidth=1.0) const
Sets the drawing pen to the cell's default foreground color.
Definition: Cell.cpp:1314
void CopyCommonData(const Cell &cell)
Copy common data (used when copying a cell)
Definition: Cell.cpp:189
virtual void PasteFromClipboard(bool primary=false)
Paste from the clipboard into this cell.
Definition: Cell.cpp:1134
bool IsHidden() const
Whether this cell is not to be drawn.
Definition: Cell.h:782
Range GetCellsInRect(const wxRect &rect) const
Returns the first and last cells within the given rectangle, recursing into the inner cells.
Definition: Cell.cpp:1169
virtual size_t GetInnerCellCount() const
The number of inner cells - for use by the iterators.
Definition: Cell.cpp:1656
void ResetSize_RecursivelyList() const
Mark all cached size information of this cell list as "to be calculated".
Definition: Cell.cpp:1224
virtual int GetImageBorderWidth() const
0 for ordinary cells, 1 for slide shows and diagrams displayed with a 1-pixel border
Definition: Cell.h:891
virtual wxString ToOMML() const
Returns the cell's representation as OMML.
Definition: Cell.cpp:1047
void SetBigSkip(bool skip)
Tell this cell to cause an additional vertical space.
Definition: Cell.h:554
bool HasBigSkip() const
Does this cell come with an additional vertical space.
Definition: Cell.h:556
virtual void UnbreakList() const
Unbreak this line.
Definition: Cell.cpp:1298
wxRect CropToUpdateRegion(wxRect rect) const
The part of the rectangle rect that is in the region that is currently drawn.
Definition: Cell.cpp:250
void SoftLineBreak(bool breakLine=true) const
Do we want this cell to start with a linebreak?
Definition: Cell.h:230
Cell * GetNextToDraw() const
Get the next cell that needs to be drawn.
Definition: Cell.h:741
CellPtr< GroupCell > m_group
The GroupCell this list of cells belongs to.
Definition: Cell.h:1056
virtual wxString ListToMatlab() const
Convert this list to its LaTeX representation.
Definition: Cell.cpp:811
virtual wxString ListToOMML(bool startofline=false) const
Convert this list to an OMML representation.
Definition: Cell.cpp:1049
GroupCell * GetGroup() const
Returns the group cell this cell belongs to.
Definition: Cell.cpp:265
virtual bool IsActive() const
Is this editor cell focused?
Definition: Cell.h:878
Configuration * GetConfiguration()
Which configuration object is responsible for this cell?
Definition: Cell.h:341
virtual wxString ListToString() const
Returns this cell list's representation as a string.
Definition: Cell.cpp:779
void BreakUpAndMark() const
Break up the internal cells of this cell, and mark it as broken up.
Definition: Cell.cpp:1276
void ForceBreakLine(bool force=true) const
Insert (or remove) a forced linebreak at the beginning of this cell.
Definition: Cell.h:380
virtual wxRect GetRect(bool wholeList=false) const
Get the smallest rectangle this cell fits in.
Definition: Cell.cpp:712
void AddExtraAttribute(const wxString &name, const wxString &value)
Adds an extra XML attribute to this cell.
Definition: Cell.cpp:1712
virtual wxCoord GetHeightList() const
Returns the total height of this line.
Definition: Cell.cpp:377
virtual void FontsChanged() const
To be called if the font has changed.
Definition: Cell.h:1158
void CollectWideCells(std::vector< const Cell * > &wideCells, int clientWidth) const
Recursively collect all cells that are too wide to fit the line.
Definition: Cell.cpp:674
virtual wxCoord GetCenterList() const
Returns the maximum distance between top and center of this line.
Definition: Cell.cpp:367
CellPtr< Cell > m_nextToDraw
The next cell in the draw list. This has been factored into Cell temporarily to reduce the change "no...
Definition: Cell.h:1059
void ClearToolTip()
Remove this cell's tooltip.
Definition: Cell.cpp:422
wxString GetUUID() const
Returns the UUID of this cell.
Definition: Cell.h:390
wxCoord GetHeight() const
Get the height of this cell.
Definition: Cell.cpp:273
Cell * GetNext() const
Get the next cell in the list.
Definition: Cell.h:734
virtual void SelectAll()
Select all editable text of this cell.
Definition: Cell.h:848
bool HasValidPosition() const
Is the position valid?
Definition: Cell.cpp:558
virtual void Unbreak() const
Undo breaking this cell into multiple lines.
Definition: Cell.cpp:1286
int GetLineIndent() const
If this were the beginning of a line: How far do we need to indent it?
Definition: Cell.cpp:573
void SetCurrentPointList(wxPoint point)
Helper to position a horizontal list of cells.
Definition: Cell.cpp:484
virtual void SetValue(const wxString &WXUNUSED(text))
Allows to change the text a TextCell contains.
Definition: Cell.h:594
wxCoord Scale_Px(double px) const
Scale font sizes and line widths according to the zoom factor.
Definition: Cell.h:176
bool ContainsPoint(wxPoint point) const
Is a given point inside this cell?
Definition: Cell.h:321
virtual bool IsShortNum() const
True if this cell represents a short number.
Definition: Cell.h:630
CellType GetType() const
Returns the type of this cell.
Definition: Cell.h:449
void SetTextColor(wxDC *dc)
Sets the text color.
Definition: Cell.cpp:1329
virtual bool CanCopy() const
Select Can we copy the editable text of this cell?
Definition: Cell.h:852
virtual wxString ListToMathML(bool startofline=false) const
Convert this list to a MathML representation.
Definition: Cell.cpp:874
virtual wxString ListToTeX() const
Convert this list to its LaTeX representation.
Definition: Cell.cpp:844
Cell * GetPrevious() const
Returns a pointer to the previous cell in the current cell list.
Definition: Cell.h:731
virtual const wxString & GetAltCopyText() const
Get the text set using SetAltCopyText - may be empty.
Definition: Cell.h:997
bool GetHidableMultSign() const
Whether this is a hidable multiplication sign.
Definition: Cell.h:982
bool HasHardLineBreak() const
Does this cell begin with a manual linebreak?
Definition: Cell.h:288
unsigned long CellsInListRecursive() const
How many cells does this cell contain?
Definition: Cell.cpp:238
virtual bool FirstLineOnlyEditor() const
True, if this GroupCell is folded and its editor shows only its first line.
Definition: Cell.cpp:174
virtual wxString ToString() const
Returns the cell's representation as a string.
Definition: Cell.cpp:763
void SetConfigurationList(Configuration *config)
Tell this cell list to use the configuration object config.
Definition: Cell.cpp:562
void AddToolTip(const wxString &tip)
Add another tooltip to this cell.
Definition: Cell.cpp:449
Cell * last() const
Get the last cell in this list of cells.
Definition: Cell.cpp:1265
virtual void ClearCache()
Clears memory from cached items automatically regenerated when the cell is drawn.
Definition: Cell.h:328
bool GetSuppressMultiplicationDot() const
Do we want to begin this cell with a center dot if it is part of a product?
Definition: Cell.h:979
virtual wxString ListToRTF(bool startofline=false) const
Convert this list to an RTF representation.
Definition: Cell.cpp:1078
virtual void SetIsExponent()
Tell this cell to be an exponent.
Definition: Cell.cpp:474
bool GetHighlight() const
Is this cell highlighted (e.G. inside a maxima box)
Definition: Cell.h:576
static wxString RTFescape(wxString, bool MarkDown=false)
Escape a string for RTF.
Definition: Cell.cpp:1005
bool HasStaleSize() const
Is the size valid, whether a recalculation is pending or not?
Definition: Cell.cpp:554
void SetHighlight(bool highlight)
Mark this cell as highlighted (e.G. being in a maxima box)
Definition: Cell.h:574
bool HasValidSize() const
Is the size valid and not pending a recalculation?
Definition: Cell.cpp:550
bool IsEditable(bool input=false) const
Is this cell editable?
Definition: Cell.h:794
wxCoord GetCurrentY() const
Get the y position of the top left of this cell.
Definition: Cell.h:495
virtual void SetIsExponentList()
Tell this list of cells to be an exponent.
Definition: Cell.cpp:468
virtual wxString ListToXML() const
Convert this list to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:1136
bool BreakLineHere() const
Are we allowed to break a line here?
Definition: Cell.h:285
void ResetSizeList() const
Mark the cached height information of the whole list of cells as "to be calculated".
Definition: Cell.cpp:509
virtual wxString GetDiffPart() const
Get the part for diff tag support.
Definition: Cell.cpp:1161
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:1176
void RecalculateList(AFontSize fontsize) const
Recalculate both width and height of this list of cells.
Definition: Cell.cpp:504
wxCoord GetCenter() const
Get the distance between the top and the center of this cell.
Definition: Cell.cpp:293
void BreakLines_List() const
Break lines in this list of cells.
Definition: Cell.cpp:583
wxPoint m_currentPoint
The point in the work sheet at which this cell begins.
Definition: Cell.h:1033
AFontSize m_fontSize
The unscaled font size.
Definition: Cell.h:1096
bool DrawThisCell()
Is this cell currently visible in the window?
Definition: Cell.cpp:536
void ClearCacheList()
Clears the cache of the whole list of cells starting with this one.
Definition: Cell.cpp:233
virtual void Hide(bool hide=true)
Hide this cell. See IsHidden() for details.
Definition: Cell.h:788
virtual void SelectPointText(wxPoint point)
Select the text at point.
Definition: Cell.cpp:1130
void SetCurrentPoint(int x, int y)
Sets the position for the cell and convenience overload.
Definition: Cell.h:939
void DrawList(wxDC *dc, wxDC *adc)
Helper to draw a list of cells.
Definition: Cell.cpp:498
virtual wxString ToXML() const
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:855
void SetUUID(const wxString &uuid)
Sets the UUID of this cell.
Definition: Cell.h:392
virtual void SetAltCopyText(const wxString &text)
What should end up if placing this cell on the clipboard?
Definition: Cell.cpp:461
virtual void SelectRectText(wxPoint one, wxPoint two)
Select the text between the two points.
Definition: Cell.cpp:1132
virtual wxString ToMathML() const
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: Cell.cpp:872
CachedInteger< wxCoord > m_height
The height of this cell.
Definition: Cell.h:1075
bool ContainsRect(const wxRect &sm, bool all=true) const
Is a part of this cell inside a certain rectangle?
Definition: Cell.cpp:1201
wxCoord SumOfWidths() const
How many pixels is this list of cells wide, if we don't break it into lines?
Definition: Cell.cpp:379
wxString VariablesAndFunctionsList() const
Returns all variable and function names used inside this list of cells.
Definition: Cell.cpp:767
virtual ~Cell()
Delete this list of cells.
Definition: Cell.cpp:92
AFontSize Scale_Px(AFontSize size) const
Scale font sizes and line widths according to the zoom factor.
Definition: Cell.h:181
virtual void SetStyle(TextStyle style)
Sets the TextStyle of this cell.
Definition: Cell.h:882
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:512
wxCoord GetLineWidth() const
How many pixels is the current line of this list of cells wide?
Definition: Cell.cpp:384
void SetNextToDraw(const std::unique_ptr< T, Del > &ptr)
Tells this cell which one should be the next cell to be drawn.
Definition: Cell.h:760
virtual wxPoint PositionToPoint()
Locates the cursor in the editable text of this cell.
Definition: Cell.h:860
void SetToolTip(const wxString &tooltip) const
Set the tooltip to a given string.
Definition: Cell.cpp:429
virtual void SetConfiguration(Configuration *config)
Tell this cell to use the configuration object config.
Definition: Cell.cpp:567
virtual void SetCurrentPoint(wxPoint point)
Pass 2: Arrangement.
Definition: Cell.cpp:480
virtual wxString GnuplotSource() const
Retrieve the gnuplot source data for this image.
Definition: Cell.h:808
virtual wxCoord GetMaxDrop() const
Returns the maximum distance between center and bottom of this line.
Definition: Cell.cpp:372
static wxString XMLescape(wxString)
Escape a string for XML.
Definition: Cell.cpp:986
virtual void Draw(wxDC *dc, wxDC *antialiassingDC)
Pass 3 (Paint): Renders the cell using pre-calculated coordinates.
Definition: Cell.cpp:400
virtual Cell * GetInnerCell(size_t index) const
Retrieve an inner cell with given index which must be less than GetInnerCellCount.
Definition: Cell.cpp:1658
virtual const wxString & GetValue() const
Gets the text this text cell contains.
Definition: Cell.cpp:1327
Configuration * m_configuration
A pointer to the configuration responsible for this worksheet.
Definition: Cell.h:1062
int GetWidth() const
Get the width of this cell.
Definition: Cell.cpp:283
virtual void SetNextToDraw(Cell *next) const
Tells this cell which one should be the next cell to be drawn.
Definition: Cell.h:750
virtual wxString ToTeX() const
Convert this cell to its LaTeX representation.
Definition: Cell.cpp:842
void ResetSize() const
Mark the cached height and width information as "to be calculated".
Definition: Cell.cpp:1229
void GenerateUUID()
Generates a new UUID for this cell.
Definition: Cell.cpp:1691
wxPoint GetCurrentPoint() const
Returns the pre-calculated worksheet position of the cell.
Definition: Cell.h:960
virtual void SetFocus(bool WXUNUSED(focus))
Focus this editor cell.
Definition: Cell.h:871
wxString GetExtraXMLAttributes() const
Returns a string containing all extra XML attributes.
Definition: Cell.cpp:1701
virtual void ProcessEvent(wxKeyEvent &WXUNUSED(event))
Processes a key event.
Definition: Cell.h:811
void SetCurrentPointDrawList(wxPoint point)
Helper to position a list of cells using the draw-list logic.
Definition: Cell.cpp:491
wxCoord GetCurrentX() const
Get the x position of the top left of this cell.
Definition: Cell.h:488
bool IsComment() const
Determine if this cell contains text that isn't code.
Definition: Cell.h:766
bool BreakUpCells() const
Cell list: Convert 2d math objects bigger than the screen width into linear form.
Definition: Cell.cpp:628
static wxString OMML2RTF(wxXmlNode *node)
Converts an OMML tag to the corresponding RTF snippet.
Definition: Cell.cpp:935
bool UnBreakUpCells() const
Convert all maths objects in this call list into their 2D form.
Definition: Cell.cpp:699
virtual void SetType(CellType type)
Sets the text style according to the type.
Definition: Cell.cpp:100
AFontSize m_fontSize_Scaled
The font size is smaller in super- and subscripts.
Definition: Cell.h:1094
virtual Range GetInnerCellsInRect(const wxRect &rect) const
Select the cells inside this cell described by the rectangle rect.
Definition: Cell.cpp:1188
CachedInteger< wxCoord > m_width
The width of this cell; is recalculated by RecalculateHeight.
Definition: Cell.h:1079
virtual bool BreakUp() const
Try to split this command into lines to make it fit on the screen.
Definition: Cell.cpp:1274
bool IsCompound() const
Do we have an operator in this line - draw () in frac...
Definition: Cell.cpp:756
wxBitmap BitmapFromSVG(wxString svgData, wxSize size)
Renders a bitmap from svgData at the requested size.
Definition: Cell.cpp:156
void ResetSize_Recursively() const
Mark all cached size information as "to be calculated".
Definition: Cell.cpp:1216
std::unique_ptr< Cell > CopyList(GroupCell *group) const
Return a copy of the list of cells beginning with this one.
Definition: Cell.cpp:213
virtual bool IsDirty() const
Is this cell marked as "from an old maxima run"?
Definition: Cell.h:864
friend auto OnInner(const C *cell)
Returns an iterable that goes over the inner cells of this cell.
Definition: Cell.h:1216
virtual bool CutToClipboard()
Cut this cell's editable contents to the clipboard.
Definition: Cell.h:844
virtual bool IsOperator() const
Is this cell an operator?
Definition: Cell.h:624
bool IsMath() const
Is this cell possibly output of maxima?
Definition: Cell.cpp:1358
wxString m_uuid
The UUID of this cell.
Definition: Cell.h:1140
virtual bool CanPopOut() const
Can this cell be popped out interactively in gnuplot?
Definition: Cell.h:802
wxCoord GetDrop() const
Get the distance between the center and the bottom of this cell.
Definition: Cell.h:443
CachedInteger< wxCoord > m_center
The distance between the top and the insertion point of this cell.
Definition: Cell.h:1085
virtual void Recalculate(AFontSize fontsize) const
Recalculate the size of the cell and the difference between top and center.
Definition: Cell.cpp:518
void FontsChangedList()
Tell a whole list of cells that their fonts have changed.
Definition: Cell.cpp:257
bool NeedsRecalculation() const
True, if something that affects the cell size has changed.
Definition: Cell.h:509
virtual bool AddEnding()
Add a semicolon to a code cell, if needed.
Definition: Cell.h:818
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:1066
virtual bool CopyToClipboard() const
Copy this cell's editable contents to the clipboard.
Definition: Cell.h:838
void SetBrush(wxDC *dc) const
Sets the fill brush to the cell's default foreground color.
Definition: Cell.cpp:1322
const TextStyle & GetTextStyle() const
Get the text style.
Definition: Cell.h:562
Cell * first() const
Get the first cell in this list of cells.
Definition: Cell.cpp:1256
virtual wxString ToRTF() const
Returns the cell's representation as RTF.
Definition: Cell.h:674
virtual wxPoint PositionToPoint(size_t WXUNUSED(pos))
Locates a char in the editable text of this cell.
Definition: Cell.h:856
The configuration storage for the current worksheet.
Definition: Configuration.h:86
std::int_fast32_t CellCfgCnt() const
A counter that increases every time we need to recalculate all worksheet cells.
Definition: Configuration.h:1103
wxCoord Scale_Px(double px) const
Scales a distance [in pixels] according to the zoom factor.
Definition: Configuration.cpp:1543
This class defines what the user sees as input cell.
Definition: EditorCell.h:59
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:87
Definition: CellIterators.h:229
Iterates the inner cells of a cell.
Definition: CellIterators.h:151
Objects deriving from this class can be observed by the CellPtr.
Definition: CellPtr.h:88
A Text cell.
Definition: TextCell.h:38
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:109
A struct that allows to specify a region of a cell list.
Definition: Cell.h:606
For the bitmap export we sometimes want to know how big the result will be...
Definition: Cell.h:637