C

Localization: Localize Safety-Critical Content

/**************************************************************************** ** ** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Safe Renderer module ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ** ** ** ** ** ** ** ****************************************************************************/
#include <QtSafeRenderer/qsafelayout.h> #include <QtSafeRenderer/qsafelayoutresourcereader.h> #include <QtSafeRenderer/statemanager.h> #include <QtSafeRenderer/qsafechecksum.h> #include "safewindow.h" #include "eventhandler.h" using namespace SafeRenderer; int main(int argc, char **argv) { (void)argc; (void)argv; // Load all the variants. static QSafeLayoutResourceReader en("/layoutData/SafeUI/en/SafeUI_en.srl"); static QSafeLayoutResourceReader fi("/layoutData/SafeUI/fi/SafeUI_fi.srl"); static QSafeLayoutResourceReader de("/layoutData/SafeUI/de/SafeUI_de.srl"); static QSafeLayoutResourceReader uk("/layoutData/SafeUI/uk/SafeUI_uk.srl"); static QSafeLayoutResourceReader el("/layoutData/SafeUI/el/SafeUI_el.srl"); static QSafeLayoutResourceReader ar("/layoutData/SafeUI/ar/SafeUI_ar.srl"); static QSafeLayoutResourceReader da("/layoutData/SafeUI/da/SafeUI_da.srl"); static QSafeLayoutResourceReader et("/layoutData/SafeUI/et/SafeUI_et.srl"); static QSafeLayoutResourceReader no("/layoutData/SafeUI/no/SafeUI_no.srl"); static QSafeLayoutResourceReader sv("/layoutData/SafeUI/sv/SafeUI_sv.srl"); en.setLayoutId(qsafe_hash_string("en")); fi.setLayoutId(qsafe_hash_string("fi")); de.setLayoutId(qsafe_hash_string("de")); uk.setLayoutId(qsafe_hash_string("uk")); el.setLayoutId(qsafe_hash_string("el")); ar.setLayoutId(qsafe_hash_string("ar")); da.setLayoutId(qsafe_hash_string("da")); et.setLayoutId(qsafe_hash_string("et")); no.setLayoutId(qsafe_hash_string("no")); sv.setLayoutId(qsafe_hash_string("sv")); SafeWindow telltaleWindow(en.size(), QSafePoint(0U, 0U)); static SafeRenderer::StateManager stateManager(telltaleWindow, en); stateManager.addLayout(&fi); stateManager.addLayout(&de); stateManager.addLayout(&uk); stateManager.addLayout(&el); stateManager.addLayout(&ar); stateManager.addLayout(&da); stateManager.addLayout(&et); stateManager.addLayout(&no); stateManager.addLayout(&sv); telltaleWindow.requestUpdate(); //Request is required because eventHandler is not running yet. EventHandler msgHandler(stateManager, telltaleWindow); //Switch to finnish layout stateManager.setLayout(&fi); msgHandler.handleEvents(); return 0; }