1
0

add screen library

This commit is contained in:
2024-01-13 19:15:18 +01:00
parent 7b660f0fe2
commit 65ff5de90f
533 changed files with 113575 additions and 2 deletions

View File

@ -0,0 +1 @@
{"remap":"yes","language":"Gb","language_index":0,"indices":[["15","T_SingleUseId1"],["0","T_SingleUseId2"],["56","T_SingleUseId3"],["63","T_SingleUseId4"],["13","T_SingleUseId5"],["37","T_SingleUseId6"],["48","T_SingleUseId7"],["69","T_SingleUseId8"],["61","T_SingleUseId9"]]}

View File

@ -0,0 +1 @@
{"languages":["Gb"],"textids":["T_SingleUseId1","T_SingleUseId2","T_SingleUseId3","T_SingleUseId4","T_SingleUseId5","T_SingleUseId6","T_SingleUseId7","T_SingleUseId8","T_SingleUseId9"]}

View File

@ -0,0 +1 @@
{"remap":"yes","languages":["Gb"],"characters":[70,114,101,113,117,32,71,101,110,58,32,2,32,2,0,82,69,65,76,84,73,77,69,32,79,83,67,73,76,76,79,83,67,79,80,69,0,49,32,109,115,32,47,32,100,105,118,0,84,114,105,103,103,101,114,0,84,114,105,97,32,45,0,49,32,107,72,122,0,43,0]}

View File

@ -0,0 +1 @@
{"databases":{"DEFAULT":[[2,"LEFT","LTR"],[2,"LEFT","LTR"],[2,"LEFT","LTR"],[2,"LEFT","LTR"],[2,"LEFT","LTR"],[2,"LEFT","LTR"],[2,"LEFT","LTR"],[1,"LEFT","LTR"],[1,"LEFT","LTR"]]},"database_list":["DEFAULT"],"fonts":{"getFont_verdana_20_4bpp":0,"getFont_verdana_40_4bpp":1,"getFont_verdana_10_4bpp":2},"generate_font_format":"0"}

View File

@ -0,0 +1 @@
{"remap":"yes","data_format":"A4","binary_translations":"no","binary_fonts":"no","font_format":"0","framebuffer_bpp":"BPP16"}

View File

@ -0,0 +1,29 @@
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#ifndef TEXTKEYSANDLANGUAGES_HPP
#define TEXTKEYSANDLANGUAGES_HPP
typedef enum
{
GB,
NUMBER_OF_LANGUAGES
} LANGUAGES;
typedef enum
{
T_SINGLEUSEID1,
T_SINGLEUSEID2,
T_SINGLEUSEID3,
T_SINGLEUSEID4,
T_SINGLEUSEID5,
T_SINGLEUSEID6,
T_SINGLEUSEID7,
T_SINGLEUSEID8,
T_SINGLEUSEID9,
NUMBER_OF_TEXT_KEYS
} TEXTS;
#endif // TEXTKEYSANDLANGUAGES_HPP

View File

@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#ifndef TYPEDTEXTDATABASE_HPP
#define TYPEDTEXTDATABASE_HPP
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/TypedText.hpp>
namespace TypedTextDatabase
{
class TypedTextData;
const touchgfx::TypedText::TypedTextData* getInstance(touchgfx::LanguageId id);
const touchgfx::TypedText::TypedTextData* getInstance();
const touchgfx::Font** getFonts();
const touchgfx::Font* setFont(touchgfx::FontId fontId, const touchgfx::Font*);
void resetFont(touchgfx::FontId fontId);
uint16_t getInstanceSize();
}
#endif

View File

@ -0,0 +1,22 @@
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#include <stdint.h>
#include <touchgfx/Unicode.hpp>
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE;
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
15, // T_SingleUseId1
0, // T_SingleUseId2
56, // T_SingleUseId3
63, // T_SingleUseId4
13, // T_SingleUseId5
37, // T_SingleUseId6
48, // T_SingleUseId7
69, // T_SingleUseId8
61 // T_SingleUseId9
};

View File

@ -0,0 +1,133 @@
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#include <stdarg.h>
#include <texts/TypedTextDatabase.hpp>
#include <touchgfx/TextProvider.hpp>
#include <touchgfx/Texts.hpp>
#include <touchgfx/TypedText.hpp>
#include <touchgfx/Unicode.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/lcd/LCD.hpp>
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 typed text database
extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[];
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
0x46, 0x72, 0x65, 0x71, 0x75, 0x20, 0x47, 0x65, 0x6e, 0x3a, 0x20, 0x2, 0x20, 0x2, 0x0, // @0 "Frequ Gen: <> <>"
0x52, 0x45, 0x41, 0x4c, 0x54, 0x49, 0x4d, 0x45, 0x20, 0x4f, 0x53, 0x43, 0x49, 0x4c, 0x4c, 0x4f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x0, // @15 "REALTIME OSCILLOSCOPE"
0x31, 0x20, 0x6d, 0x73, 0x20, 0x2f, 0x20, 0x64, 0x69, 0x76, 0x0, // @37 "1 ms / div"
0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x0, // @48 "Trigger"
0x54, 0x72, 0x69, 0x61, 0x20, 0x2d, 0x0, // @56 "Tria -"
0x31, 0x20, 0x6b, 0x48, 0x7a, 0x0, // @63 "1 kHz"
0x2b, 0x0 // @69 "+"
};
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern uint32_t const 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<touchgfx::LanguageId>(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 &currentLanguagePtr[currentLanguageIndices[id]];
}

View File

@ -0,0 +1,81 @@
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#include <touchgfx/TypedText.hpp>
#include <fonts/GeneratedFont.hpp>
#include <texts/TypedTextDatabase.hpp>
extern touchgfx::GeneratedFont& getFont_verdana_20_4bpp();
extern touchgfx::GeneratedFont& getFont_verdana_40_4bpp();
extern touchgfx::GeneratedFont& getFont_verdana_10_4bpp();
const touchgfx::Font* touchgfx_fonts[] =
{
&(getFont_verdana_20_4bpp()),
&(getFont_verdana_40_4bpp()),
&(getFont_verdana_10_4bpp())
};
extern const touchgfx::TypedText::TypedTextData typedText_database_DEFAULT[];
extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[];
TEXT_LOCATION_FLASH_PRAGMA
const touchgfx::TypedText::TypedTextData typedText_database_DEFAULT[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 2, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 1, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
{ 1, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR }
};
TEXT_LOCATION_FLASH_PRAGMA
const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
typedText_database_DEFAULT
};
namespace TypedTextDatabase
{
const touchgfx::TypedText::TypedTextData* getInstance(touchgfx::LanguageId id)
{
return typedTextDatabaseArray[id];
}
uint16_t getInstanceSize()
{
return sizeof(typedText_database_DEFAULT) / sizeof(touchgfx::TypedText::TypedTextData);
}
const touchgfx::Font** getFonts()
{
return touchgfx_fonts;
}
const touchgfx::Font* setFont(touchgfx::FontId fontId, const touchgfx::Font* font)
{
const touchgfx::Font* old = touchgfx_fonts[fontId];
touchgfx_fonts[fontId] = font;
return old;
}
void resetFont(touchgfx::FontId fontId)
{
switch (fontId)
{
case 0:
touchgfx_fonts[0] = &(getFont_verdana_20_4bpp());
break;
case 1:
touchgfx_fonts[1] = &(getFont_verdana_40_4bpp());
break;
case 2:
touchgfx_fonts[2] = &(getFont_verdana_10_4bpp());
break;
}
}
} // namespace TypedTextDatabase