/* DO NOT EDIT THIS FILE */ /* This file is autogenerated by the text-database code generator */ #include #include #include #include #include #include #include #include uint16_t touchgfx::Font::getStringWidth(const touchgfx::Unicode::UnicodeChar* text, ...) const { va_list pArg; va_start(pArg, text); uint16_t width = getStringWidthLTR(TEXT_DIRECTION_LTR, text, pArg); va_end(pArg); return width; } uint16_t touchgfx::Font::getStringWidth(touchgfx::TextDirection textDirection, const touchgfx::Unicode::UnicodeChar* text, ...) const { va_list pArg; va_start(pArg, text); uint16_t width = getStringWidthLTR(textDirection, text, pArg); va_end(pArg); return width; } touchgfx::Unicode::UnicodeChar touchgfx::TextProvider::getNextLigature(TextDirection direction) { if (fontGsubTable && nextCharacters.peekChar()) { substituteGlyphs(); if (nextCharacters.peekChar(1) == 0x093F) // Hindi I-matra { nextCharacters.replaceAt1(nextCharacters.peekChar()); nextCharacters.replaceAt0(0x093F); } } return getNextChar(); } void touchgfx::TextProvider::initializeInternal() { fillInputBuffer(); } void touchgfx::LCD::drawString(touchgfx::Rect widgetArea, const touchgfx::Rect& invalidatedArea, const touchgfx::LCD::StringVisuals& stringVisuals, const touchgfx::Unicode::UnicodeChar* format, ...) { va_list pArg; va_start(pArg, format); drawStringLTR(widgetArea, invalidatedArea, stringVisuals, format, pArg); va_end(pArg); } // Default TypedTextDatabase extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[]; TEXT_LOCATION_FLASH_PRAGMA KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCATION_FLASH_ATTRIBUTE = { 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x61, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0, // @0 "Choose a mission" 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x21, 0x0, // @17 "Invalid Mission!" 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0, // @34 "Invalid Mission" 0x50, 0x72, 0x65, 0x73, 0x73, 0x75, 0x72, 0x65, 0x20, 0x41, 0x63, 0x63, 0x20, 0x41, 0x3a, 0x0, // @50 "Pressure Acc A:" 0x50, 0x72, 0x65, 0x73, 0x73, 0x75, 0x72, 0x65, 0x20, 0x41, 0x63, 0x63, 0x20, 0x42, 0x3a, 0x0, // @66 "Pressure Acc B:" 0x50, 0x72, 0x65, 0x73, 0x73, 0x75, 0x72, 0x65, 0x20, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x3a, 0x0, // @82 "Pressure Front:" 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x44, 0x72, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x0, // @98 "Manual Driving" 0x50, 0x72, 0x65, 0x73, 0x73, 0x75, 0x72, 0x65, 0x20, 0x52, 0x65, 0x61, 0x72, 0x3a, 0x0, // @113 "Pressure Rear:" 0x41, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0, // @128 "Acceleration" 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0, // @141 "Inspection" 0x50, 0x41, 0x52, 0x41, 0x4d, 0x45, 0x54, 0x45, 0x52, 0x53, 0x0, // @152 "PARAMETERS" 0x54, 0x72, 0x61, 0x63, 0x6b, 0x64, 0x72, 0x69, 0x76, 0x65, 0x0, // @163 "Trackdrive" 0x41, 0x4d, 0x53, 0x20, 0x45, 0x72, 0x72, 0x4f, 0x72, 0x0, // @174 "AMS ErrOr" 0x41, 0x75, 0x74, 0x6f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x0, // @184 "Autocross" 0x50, 0x52, 0x45, 0x43, 0x48, 0x41, 0x52, 0x47, 0x45, 0x0, // @194 "PRECHARGE" 0x2, 0x25, 0x0, // @204 "<>%" 0x45, 0x42, 0x53, 0x20, 0x54, 0x65, 0x73, 0x74, 0x0, // @207 "EBS Test" 0x2, 0x0, // @216 "<>" 0x41, 0x53, 0x53, 0x54, 0x41, 0x54, 0x45, 0x0, // @218 "ASSTATE" 0x44, 0x53, 0x50, 0x45, 0x45, 0x44, 0x3a, 0x0, // @226 "DSPEED:" 0x49, 0x43, 0x53, 0x54, 0x41, 0x54, 0x45, 0x0, // @234 "ICSTATE" 0x49, 0x4e, 0x56, 0x4c, 0x52, 0x44, 0x59, 0x0, // @242 "INVLRDY" 0x49, 0x4e, 0x56, 0x52, 0x52, 0x44, 0x59, 0x0, // @250 "INVRRDY" 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x0, // @258 "MISSION" 0x4d, 0x53, 0x50, 0x45, 0x45, 0x44, 0x3a, 0x0, // @266 "MSPEED:" 0x52, 0x32, 0x44, 0x50, 0x52, 0x4f, 0x47, 0x0, // @274 "R2DPROG" 0x53, 0x6b, 0x69, 0x64, 0x70, 0x61, 0x64, 0x0, // @282 "Skidpad" 0x54, 0x53, 0x53, 0x54, 0x41, 0x54, 0x45, 0x0, // @290 "TSSTATE" 0x42, 0x52, 0x41, 0x4b, 0x45, 0x53, 0x0, // @298 "BRAKES" 0x54, 0x53, 0x56, 0x42, 0x41, 0x54, 0x0, // @305 "TSVBAT" 0x54, 0x53, 0x56, 0x56, 0x45, 0x48, 0x0, // @312 "TSVVEH" 0x44, 0x41, 0x4e, 0x47, 0x3a, 0x0, // @319 "DANG:" 0x45, 0x52, 0x52, 0x4f, 0x52, 0x0, // @325 "ERROR" 0x4c, 0x56, 0x53, 0x4f, 0x43, 0x0, // @331 "LVSOC" 0x4d, 0x41, 0x4e, 0x47, 0x3a, 0x0, // @337 "MANG:" 0x53, 0x50, 0x45, 0x45, 0x44, 0x0, // @343 "SPEED" 0x54, 0x53, 0x53, 0x4f, 0x43, 0x0, // @349 "TSSOC" 0x42, 0x42, 0x41, 0x4c, 0x0, // @355 "BBAL" 0x49, 0x4e, 0x49, 0x54, 0x0, // @360 "INIT" 0x4c, 0x41, 0x50, 0x53, 0x0, // @365 "LAPS" 0x54, 0x4d, 0x41, 0x58, 0x0, // @370 "TMAX" 0x54, 0x54, 0x46, 0x4c, 0x0, // @375 "TTFL" 0x54, 0x54, 0x46, 0x52, 0x0, // @380 "TTFR" 0x54, 0x54, 0x52, 0x4c, 0x0, // @385 "TTRL" 0x54, 0x54, 0x52, 0x52, 0x0, // @390 "TTRR" 0x56, 0x4d, 0x49, 0x4e, 0x0, // @395 "VMIN" 0x41, 0x4d, 0x53, 0x0, // @400 "AMS" 0x49, 0x4e, 0x56, 0x0, // @404 "INV" 0x49, 0x54, 0x53, 0x0, // @408 "ITS" 0x50, 0x44, 0x55, 0x0, // @412 "PDU" 0x52, 0x32, 0x44, 0x0, // @416 "R2D" 0x53, 0x43, 0x53, 0x0, // @420 "SCS" 0x53, 0x44, 0x43, 0x0, // @424 "SDC" 0x4c, 0x56, 0x0 // @428 "LV" }; TEXT_LOCATION_FLASH_PRAGMA KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE; // Array holding dynamically installed languages struct TranslationHeader { uint32_t offset_to_texts; uint32_t offset_to_indices; uint32_t offset_to_typedtext; }; static const TranslationHeader* languagesArray[1] = { 0 }; // Compiled and linked in languages static const uint32_t* const staticLanguageIndices[] = { indicesGb }; touchgfx::LanguageId touchgfx::Texts::currentLanguage = static_cast(0); static const touchgfx::Unicode::UnicodeChar* currentLanguagePtr = 0; static const uint32_t* currentLanguageIndices = 0; void touchgfx::Texts::setLanguage(touchgfx::LanguageId id) { const touchgfx::TypedText::TypedTextData* currentLanguageTypedText = 0; if (id < 1) { if (languagesArray[id] != 0) { // Dynamic translation is added const TranslationHeader* translation = languagesArray[id]; currentLanguagePtr = (const touchgfx::Unicode::UnicodeChar*)(((const uint8_t*)translation) + translation->offset_to_texts); currentLanguageIndices = (const uint32_t*)(((const uint8_t*)translation) + translation->offset_to_indices); currentLanguageTypedText = (const touchgfx::TypedText::TypedTextData*)(((const uint8_t*)translation) + translation->offset_to_typedtext); } else { // Compiled and linked in languages currentLanguagePtr = texts_all_languages; currentLanguageIndices = staticLanguageIndices[id]; currentLanguageTypedText = typedTextDatabaseArray[id]; } } if (currentLanguageTypedText) { currentLanguage = id; touchgfx::TypedText::registerTypedTextDatabase(currentLanguageTypedText, TypedTextDatabase::getFonts(), TypedTextDatabase::getInstanceSize()); } } void touchgfx::Texts::setTranslation(touchgfx::LanguageId id, const void* translation) { languagesArray[id] = (const TranslationHeader*)translation; } const touchgfx::Unicode::UnicodeChar* touchgfx::Texts::getText(TypedTextId id) const { return ¤tLanguagePtr[currentLanguageIndices[id]]; }