Files
Upsilon/apps/graph/function_store.h
Émilie Feral a4a0a4b298 [apps/graph/list] improve the drawing of the list of function
Change-Id: I0e0ea607988fdb6debeb7c48a04945519859db19
2016-10-12 17:39:50 +02:00

39 lines
1.1 KiB
C++

#ifndef GRAPH_FUNCTION_STORE_H
#define GRAPH_FUNCTION_STORE_H
#include "function.h"
namespace Graph {
/* FunctionStore is a dumb class.
* Its only job is to store functions and to give them a color. */
class FunctionStore {
public:
FunctionStore();
Function * functionAtIndex(int i);
Function * activeFunctionAtIndex(int i);
Function * addEmptyFunction();
void removeFunction(Function * f);
int numberOfFunctions();
int numberOfActiveFunctions();
private:
const char * firstAvailableName();
const KDColor firstAvailableColor();
static constexpr int k_maxNumberOfFunctions = 8;
static constexpr int k_numberOfDefaultColors = 10;
static constexpr KDColor k_defaultColors[k_numberOfDefaultColors] = {
KDColor(0xE5473E), KDColor(0x57B1D9), KDColor(0xE49832), KDColor(0x6DBE51),
KDColor(0x199B99), KDColor(0xF2A37C), KDColor(0x37C995), KDColor(0x6759D0),
KDColor(0xEF7138), KDColor(0x1774C5)
};
static constexpr const char * k_functionNames[k_maxNumberOfFunctions] = {
"f", "g", "h", "i", "j", "k", "l", "m"
};
int m_numberOfFunctions;
Function m_functions[k_maxNumberOfFunctions];
};
}
#endif