[apps] Store function metadata in record

This commit is contained in:
Léa Saviot
2018-10-08 17:35:46 +02:00
committed by Émilie Feral
parent 20e440a216
commit 2793a622e2
6 changed files with 31 additions and 6 deletions

View File

@@ -13,19 +13,19 @@ uint32_t StorageFunction::checksum() {
}
bool StorageFunction::isActive() const {
return true; //TODO
return recordData()->isActive();
}
KDColor StorageFunction::color() const {
return KDColorRed; //TODO
return recordData()->color();
}
void StorageFunction::setActive(bool active) {
//TODO
recordData()->setActive(active);
}
void StorageFunction::setColor(KDColor color) {
//TODO
recordData()->setColor(color);
}
template<typename T>
@@ -33,6 +33,12 @@ T StorageFunction::templatedApproximateAtAbscissa(T x, Poincare::Context * conte
return reducedExpression(context).approximateWithValueForSymbol(symbol(), x, *context, Preferences::sharedPreferences()->angleUnit());
}
StorageFunction::FunctionRecordData * StorageFunction::recordData() const {
assert(!record().isNull());
Ion::Storage::Record::Data d = record().value();
return reinterpret_cast<FunctionRecordData *>(const_cast<void *>(d.buffer));
}
}
template float Shared::StorageFunction::templatedApproximateAtAbscissa<float>(float, Poincare::Context*) const;