From c5f86e136bfebf7cfab9bfd922fd56ed81503a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 9 Oct 2018 15:14:54 +0200 Subject: [PATCH] [apps] Delete unused ListController --- apps/graph/Makefile | 1 - apps/graph/list/list_controller.cpp | 69 ----------------------------- apps/graph/list/list_controller.h | 33 -------------- 3 files changed, 103 deletions(-) delete mode 100644 apps/graph/list/list_controller.cpp delete mode 100644 apps/graph/list/list_controller.h diff --git a/apps/graph/Makefile b/apps/graph/Makefile index fe6bac0db..30ba77f75 100644 --- a/apps/graph/Makefile +++ b/apps/graph/Makefile @@ -26,7 +26,6 @@ app_objs += $(addprefix apps/graph/,\ graph/storage_intersection_graph_controller.o\ graph/storage_tangent_graph_controller.o\ graph/tangent_graph_controller.o\ - list/list_controller.o\ list/storage_list_controller.o\ values/derivative_parameter_controller.o\ values/function_parameter_controller.o\ diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp deleted file mode 100644 index 97a723dd4..000000000 --- a/apps/graph/list/list_controller.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "list_controller.h" -#include "../app.h" -#include "../../i18n.h" -#include -#include - -using namespace Shared; - -namespace Graph { - -ListController::ListController(Responder * parentResponder, CartesianFunctionStore * functionStore, ButtonRowController * header, ButtonRowController * footer) : - Shared::FunctionListController(parentResponder, functionStore, header, footer, I18n::Message::AddFunction), - m_functionTitleCells{}, - m_expressionCells{}, - m_parameterController(this, functionStore, I18n::Message::FunctionColor, I18n::Message::DeleteFunction) -{ - for (int i = 0; i < k_maxNumberOfRows; i++) { - m_expressionCells[i].setLeftMargin(k_expressionMargin); - } -} - -const char * ListController::title() { - return I18n::translate(I18n::Message::FunctionTab); -} - -ListParameterController * ListController::parameterController() { - return &m_parameterController; -} - -int ListController::maxNumberOfRows() { - return k_maxNumberOfRows; -} - -HighlightCell * ListController::titleCells(int index) { - assert(index >= 0 && index < k_maxNumberOfRows); - return &m_functionTitleCells[index]; -} - -HighlightCell * ListController::expressionCells(int index) { - assert(index >= 0 && index < k_maxNumberOfRows); - return &m_expressionCells[index]; -} - -void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) { - Shared::BufferFunctionTitleCell * myFunctionCell = (Shared::BufferFunctionTitleCell *)cell; - CartesianFunction * function = ((CartesianFunctionStore *)m_functionStore)->modelAtIndex(j); - char bufferName[5] = {*function->name(),'(', m_functionStore->symbol(),')', 0}; - myFunctionCell->setText(bufferName); - KDColor functionNameColor = function->isActive() ? function->color() : Palette::GreyDark; - myFunctionCell->setColor(functionNameColor); -} - -void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) { - Shared::FunctionListController::willDisplayExpressionCellAtIndex(cell, j); - FunctionExpressionCell * myCell = (FunctionExpressionCell *)cell; - Function * f = m_functionStore->modelAtIndex(j); - bool active = f->isActive(); - KDColor textColor = active ? KDColorBlack : Palette::GreyDark; - myCell->setTextColor(textColor); -} - -bool ListController::removeModelRow(ExpressionModel * model) { - if (m_functionStore->numberOfModels() > 1) { - return Shared::FunctionListController::removeModelRow(model); - } - return false; -} - -} diff --git a/apps/graph/list/list_controller.h b/apps/graph/list/list_controller.h deleted file mode 100644 index 4528e8191..000000000 --- a/apps/graph/list/list_controller.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef GRAPH_LIST_CONTROLLER_H -#define GRAPH_LIST_CONTROLLER_H - -#include -#include "../../shared/function_list_controller.h" -#include "../cartesian_function_store.h" -#include "../../shared/buffer_function_title_cell.h" -#include "../../shared/function_expression_cell.h" -#include "../../shared/list_parameter_controller.h" - -namespace Graph { - -class ListController : public Shared::FunctionListController { -public: - ListController(Responder * parentResponder, CartesianFunctionStore * functionStore, ButtonRowController * header, ButtonRowController * footer); - const char * title() override; -private: - Shared::ListParameterController * parameterController() override; - int maxNumberOfRows() override; - HighlightCell * titleCells(int index) override; - HighlightCell * expressionCells(int index) override; - void willDisplayTitleCellAtIndex(HighlightCell * cell, int j) override; - void willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) override; - bool removeModelRow(Shared::ExpressionModel * function) override; - constexpr static int k_maxNumberOfRows = 5; - Shared::BufferFunctionTitleCell m_functionTitleCells[k_maxNumberOfRows]; - Shared::FunctionExpressionCell m_expressionCells[k_maxNumberOfRows]; - Shared::ListParameterController m_parameterController; -}; - -} - -#endif