From 675a0d3f4c085364ac3256bcdef2a62f1546d30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 15 Apr 2020 15:59:29 +0200 Subject: [PATCH] Add missing definition of static member variables --- apps/probability/calculation_controller.cpp | 2 ++ apps/shared/function_list_controller.cpp | 2 ++ apps/shared/values_controller.cpp | 3 ++ escher/Makefile | 1 + escher/src/expression_field.cpp | 3 ++ escher/src/metric.cpp | 33 +++++++++++++++++++++ poincare/src/nth_root_layout.cpp | 3 ++ poincare/src/print_float.cpp | 2 ++ 8 files changed, 49 insertions(+) create mode 100644 escher/src/metric.cpp diff --git a/apps/probability/calculation_controller.cpp b/apps/probability/calculation_controller.cpp index 0f8d901b9..a0782cdf3 100644 --- a/apps/probability/calculation_controller.cpp +++ b/apps/probability/calculation_controller.cpp @@ -23,6 +23,8 @@ using namespace Shared; namespace Probability { +constexpr int CalculationController::k_titleBufferSize; + CalculationController::ContentView::ContentView(SelectableTableView * selectableTableView, Distribution * distribution, Calculation * calculation) : m_titleView(KDFont::SmallFont, I18n::Message::ComputeProbability, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), m_selectableTableView(selectableTableView), diff --git a/apps/shared/function_list_controller.cpp b/apps/shared/function_list_controller.cpp index bac65396f..e6a0ab109 100644 --- a/apps/shared/function_list_controller.cpp +++ b/apps/shared/function_list_controller.cpp @@ -5,6 +5,8 @@ namespace Shared { +constexpr KDCoordinate FunctionListController::k_minTitleColumnWidth; + FunctionListController::FunctionListController(Responder * parentResponder, ButtonRowController * header, ButtonRowController * footer, I18n::Message text) : ExpressionModelListController(parentResponder, text), ButtonRowDelegate(header, footer), diff --git a/apps/shared/values_controller.cpp b/apps/shared/values_controller.cpp index cc6fc984b..864b38f3e 100644 --- a/apps/shared/values_controller.cpp +++ b/apps/shared/values_controller.cpp @@ -9,6 +9,9 @@ using namespace Poincare; namespace Shared { +constexpr int ValuesController::k_maxNumberOfDisplayableRows; + +// TODO: use std::abs static inline int absInt(int x) { return x < 0 ? -x : x; } // Constructor and helpers diff --git a/escher/Makefile b/escher/Makefile index d1caa59ed..f47a998ac 100644 --- a/escher/Makefile +++ b/escher/Makefile @@ -45,6 +45,7 @@ escher_src += $(addprefix escher/src/,\ message_table_cell_with_message.cpp \ message_table_cell_with_switch.cpp \ message_text_view.cpp \ + metric.cpp \ modal_view_controller.cpp \ nested_menu_controller.cpp \ palette.cpp \ diff --git a/escher/src/expression_field.cpp b/escher/src/expression_field.cpp index 16b77155a..300f1d039 100644 --- a/escher/src/expression_field.cpp +++ b/escher/src/expression_field.cpp @@ -3,6 +3,9 @@ #include #include +constexpr KDCoordinate ExpressionField::k_maximalHeight; +constexpr KDCoordinate ExpressionField::k_minimalHeight; + ExpressionField::ExpressionField(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * textFieldDelegate, LayoutFieldDelegate * layoutFieldDelegate) : Responder(parentResponder), View(), diff --git a/escher/src/metric.cpp b/escher/src/metric.cpp new file mode 100644 index 000000000..1ff05788f --- /dev/null +++ b/escher/src/metric.cpp @@ -0,0 +1,33 @@ +#include + +constexpr KDCoordinate Metric::CellMargin; +constexpr KDCoordinate Metric::CommonLeftMargin; +constexpr KDCoordinate Metric::CommonRightMargin; +constexpr KDCoordinate Metric::CommonTopMargin; +constexpr KDCoordinate Metric::CommonBottomMargin; +constexpr KDCoordinate Metric::CommonLargeMargin; +constexpr KDCoordinate Metric::CommonSmallMargin; +constexpr KDCoordinate Metric::TitleBarExternHorizontalMargin; +constexpr KDCoordinate Metric::TitleBarHeight; +constexpr KDCoordinate Metric::ParameterCellHeight; +constexpr KDCoordinate Metric::ModalTopMargin; +constexpr KDCoordinate Metric::ModalBottomMargin; +constexpr KDCoordinate Metric::TableCellVerticalMargin; +constexpr KDCoordinate Metric::TableCellHorizontalMargin; +constexpr KDCoordinate Metric::TabHeight; +constexpr KDCoordinate Metric::ScrollStep; +constexpr KDCoordinate Metric::PopUpLeftMargin; +constexpr KDCoordinate Metric::PopUpRightMargin; +constexpr KDCoordinate Metric::PopUpTopMargin; +constexpr KDCoordinate Metric::ExamPopUpTopMargin; +constexpr KDCoordinate Metric::ExamPopUpBottomMargin; +constexpr KDCoordinate Metric::StoreRowHeight; +constexpr KDCoordinate Metric::ToolboxRowHeight; +constexpr KDCoordinate Metric::StackTitleHeight; +constexpr KDCoordinate Metric::FractionAndConjugateHorizontalOverflow; +constexpr KDCoordinate Metric::FractionAndConjugateHorizontalMargin; +constexpr KDCoordinate Metric::MinimalBracketAndParenthesisHeight; +constexpr KDCoordinate Metric::CellSeparatorThickness; +constexpr KDCoordinate Metric::TableSeparatorThickness; +constexpr KDCoordinate Metric::ExpressionViewHorizontalMargin; +constexpr KDCoordinate Metric::EllipsisCellWidth; diff --git a/poincare/src/nth_root_layout.cpp b/poincare/src/nth_root_layout.cpp index c27e82a6b..fac507a43 100644 --- a/poincare/src/nth_root_layout.cpp +++ b/poincare/src/nth_root_layout.cpp @@ -8,6 +8,9 @@ namespace Poincare { +constexpr KDCoordinate NthRootLayoutNode::k_leftRadixHeight; +constexpr KDCoordinate NthRootLayoutNode::k_leftRadixWidth; + const uint8_t radixPixel[NthRootLayoutNode::k_leftRadixHeight][NthRootLayoutNode::k_leftRadixWidth] = { {0x51, 0xCC, 0xFF, 0xFF, 0xFF}, {0x96, 0x37, 0xFD, 0xFF, 0xFF}, diff --git a/poincare/src/print_float.cpp b/poincare/src/print_float.cpp index 3957a1a53..0aa8e66fc 100644 --- a/poincare/src/print_float.cpp +++ b/poincare/src/print_float.cpp @@ -19,6 +19,8 @@ extern "C" { namespace Poincare { +constexpr int PrintFloat::Long::k_maxNumberOfCharsForDigit; + PrintFloat::Long::Long(int64_t i) : m_negative(i < 0) {