2 #include "../sequence_store.h" 3 #include "../../../poincare/src/layout/baseline_relative_layout.h" 4 #include "../../../poincare/src/layout/string_layout.h" 11 SequenceToolbox::SequenceToolbox() :
14 m_numberOfAddedCells(0)
20 if (m_addedCellLayout[i]) {
21 delete m_addedCellLayout[i];
22 m_addedCellLayout[i] =
nullptr;
49 return &m_addedCells[index];
61 if (
stackDepth() == 0 && j < m_numberOfAddedCells) {
69 if (m_addedCellLayout[i]) {
70 delete m_addedCellLayout[i];
71 m_addedCellLayout[i] =
nullptr;
76 if (recurrenceDepth < 0) {
77 m_numberOfAddedCells = 0;
85 m_numberOfAddedCells = recurrenceDepth == 2 ? 2*recurrenceDepth : 2*recurrenceDepth+1;
88 for (
int j = 0; j < recurrenceDepth; j++) {
89 const char * indice = j == 0 ?
"n" :
"n+1";
93 if (recurrenceDepth < 2) {
94 const char * indice = recurrenceDepth == 0 ?
"n" : (recurrenceDepth == 1 ?
"n+1" :
"n+2");
102 bool SequenceToolbox::selectAddedCell(
int selectedRow){
110 buffer[currentChar++] =
'(';
112 currentChar +=
strlen(subscriptLayout->
text());
113 buffer[currentChar++] =
')';
114 buffer[currentChar] = 0;
120 int SequenceToolbox::mathToolboxIndex(
int index) {
121 int indexMathToolbox = index;
123 indexMathToolbox = index - m_numberOfAddedCells;
125 return indexMathToolbox;
ExpressionLayout * indiceLayout()
size_t strlcpy(char *dst, const char *src, size_t len)
ExpressionLayout * baseLayout()
size_t strlen(const char *s)
void setExpression(Poincare::ExpressionLayout *expressionLayout)
bool handleEventWithText(const char *text, bool indenting=false) override
static constexpr const char * k_sequenceNames[MaxNumberOfSequences]
void dismissModalViewController()