From 95d0715606b907a1f7b095607d1037436d8fc6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 10 Oct 2019 15:22:04 +0200 Subject: [PATCH] [escher/solid_text_area] Remove unused class --- escher/Makefile | 1 - escher/include/escher/solid_text_area.h | 39 ------------------------- escher/src/solid_text_area.cpp | 21 ------------- 3 files changed, 61 deletions(-) delete mode 100644 escher/include/escher/solid_text_area.h delete mode 100644 escher/src/solid_text_area.cpp diff --git a/escher/Makefile b/escher/Makefile index ee4f501d2..21a93b8a0 100644 --- a/escher/Makefile +++ b/escher/Makefile @@ -60,7 +60,6 @@ escher_src += $(addprefix escher/src/,\ simple_list_view_data_source.cpp \ simple_table_view_data_source.cpp \ solid_color_view.cpp \ - solid_text_area.cpp \ stack_view.cpp \ stack_view_controller.cpp \ switch_view.cpp \ diff --git a/escher/include/escher/solid_text_area.h b/escher/include/escher/solid_text_area.h deleted file mode 100644 index e19a40f9e..000000000 --- a/escher/include/escher/solid_text_area.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef ESCHER_SOLID_TEXT_AREA_H -#define ESCHER_SOLID_TEXT_AREA_H - -#include -#include - -/* SolidTextArea is a text area that draws text in a single solid color over a - * solid background. */ - -class SolidTextArea : public TextArea { -public: - SolidTextArea(Responder * parentResponder, const KDFont * font = KDFont::LargeFont, - KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite) : - TextArea(parentResponder, &m_contentView, font), - m_contentView(font, textColor, backgroundColor) {} -protected: - class ContentView : public TextArea::ContentView { - public: - ContentView(const KDFont * font, KDColor textColor, KDColor backgroundColor, KDColor backgroundHighlightColor = Palette::Select) : - TextArea::ContentView(font), - m_textColor(textColor), - m_backgroundColor(backgroundColor), - m_backgroundHighlightColor(backgroundHighlightColor) - { - } - void clearRect(KDContext * ctx, KDRect rect) const override; - void drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn, const char * selectionStart, const char * selectionEnd) const override; - private: - KDColor m_textColor; - KDColor m_backgroundColor; - KDColor m_backgroundHighlightColor; - }; - -private: - const ContentView * nonEditableContentView() const override { return &m_contentView; } - ContentView m_contentView; -}; - -#endif diff --git a/escher/src/solid_text_area.cpp b/escher/src/solid_text_area.cpp deleted file mode 100644 index c035618b1..000000000 --- a/escher/src/solid_text_area.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -static inline int minInt(int x, int y) { return x < y ? x : y; } - -void SolidTextArea::ContentView::clearRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(rect, m_backgroundColor); -} - -void SolidTextArea::ContentView::drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn, const char * selectionStart, const char * selectionEnd) const { - drawStringAt( - ctx, - line, - fromColumn, - text + fromColumn, - minInt(length - fromColumn, toColumn - fromColumn), - m_textColor, - m_backgroundColor, - selectionStart, - selectionEnd, - m_backgroundHighlightColor); -}