From 1fc2fad1237cf8ca76c127ef678422f0c4942935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 10 Oct 2018 11:21:15 +0200 Subject: [PATCH] [shared] Delete storage_function_banner_delegate --- .../shared/storage_function_banner_delegate.h | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 apps/shared/storage_function_banner_delegate.h diff --git a/apps/shared/storage_function_banner_delegate.h b/apps/shared/storage_function_banner_delegate.h deleted file mode 100644 index 9d80df911..000000000 --- a/apps/shared/storage_function_banner_delegate.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef SHARED_STORAGE_FUNCTION_BANNER_DELEGATE_H -#define SHARED_STORAGE_FUNCTION_BANNER_DELEGATE_H - -#include "banner_view.h" -#include "curve_view_cursor.h" -#include "poincare_helpers.h" -#include "../constant.h" - -namespace Shared { - -template -class StorageFunctionBannerDelegate { -public: - constexpr static int k_maxNumberOfCharacters = 50; - constexpr static int k_maxDigitLegendLength = 11; -protected: - void reloadBannerViewForCursorOnFunction(CurveViewCursor * cursor, T * function, char symbol) { - char buffer[k_maxNumberOfCharacters+Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)]; - const char * space = " "; - int spaceLength = strlen(space); - const char * legend = "0="; - int legendLength = strlen(legend); - int numberOfChar = 0; - strlcpy(buffer, legend, legendLength+1); - numberOfChar += legendLength; - buffer[0] = symbol; - numberOfChar += PoincareHelpers::ConvertFloatToText(cursor->x(), buffer+numberOfChar, Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::MediumNumberOfSignificantDigits), Constant::MediumNumberOfSignificantDigits); - strlcpy(buffer+numberOfChar, space, spaceLength+1); - buffer[k_maxDigitLegendLength+2] = 0; - bannerView()->setLegendAtIndex(buffer, 0); - - numberOfChar = 0; - legend = "0(x)="; - legendLength = strlen(legend); - numberOfChar += legendLength; - strlcpy(buffer, legend, legendLength+1); - buffer[2] = symbol; - buffer[0] = function->name()[0]; - numberOfChar += PoincareHelpers::ConvertFloatToText(cursor->y(), buffer+legendLength, Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::MediumNumberOfSignificantDigits), Constant::MediumNumberOfSignificantDigits); - strlcpy(buffer+numberOfChar, space, spaceLength+1); - buffer[k_maxDigitLegendLength+5] = 0; - bannerView()->setLegendAtIndex(buffer, 1); - } - virtual BannerView * bannerView() = 0; -}; - -} - -#endif