mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01:00
[apps/graphs] Modify how functions are handled by the function store
Change-Id: I0d7a989526440a3b6d6a925b30d0d8742017e3f9
This commit is contained in:
@@ -1,20 +1,30 @@
|
||||
#include "function.h"
|
||||
#include <string.h>
|
||||
|
||||
Graph::Function::Function() :
|
||||
m_text(nullptr),
|
||||
m_name(nullptr),
|
||||
m_expression(nullptr),
|
||||
m_layout(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
Graph::Function::Function(const char * text, KDColor color) :
|
||||
m_text(text), // FIXME: Copy !!
|
||||
m_name("f(x)"),
|
||||
m_color(color),
|
||||
m_expression(nullptr),
|
||||
m_layout(nullptr),
|
||||
m_active(true)
|
||||
{
|
||||
void Graph::Function::setContent(const char * c) {
|
||||
#if __GLIBC__
|
||||
// FIXME: This is ugly.
|
||||
strncpy(m_text, c, sizeof(m_text));
|
||||
#else
|
||||
strlcpy(m_text, c, sizeof(m_text));
|
||||
#endif
|
||||
m_expression = expression();
|
||||
m_layout = layout();
|
||||
}
|
||||
|
||||
void Graph::Function::setColor(KDColor color) {
|
||||
m_color = color;
|
||||
}
|
||||
|
||||
void Graph::Function::setName(const char * c) {
|
||||
m_name = c;
|
||||
}
|
||||
|
||||
Graph::Function::~Function() {
|
||||
|
||||
Reference in New Issue
Block a user