/**************************************************************************** ** ** Copyright (C) 2021 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$ ** ** ** ** ** ** ** ** ****************************************************************************/ #if defined(QSR_HOST_BUILD) #include #endif #include #include #include #include #include #include "safewindow.h" #include "eventhandler.h" using namespace SafeRenderer; #define nameToHash(name) qsafe_hash(name, safe_strlen(name)) StateManager *g_stateManagerPtr = NULL; static bool filterEvents(const QSafeEvent &event) { if (event.type() == EventSetVisibility) { QSafeEventVisibility visibility(event); if (g_stateManagerPtr && visibility.id() == nameToHash("turnleft")) { std::cerr << "ofoffo2"; QSafeEventChangeState stateChange; stateChange.setId(visibility.id()); if (visibility.getValue() == 1U) { stateChange.setName(nameToHash("show")); } else { stateChange.setName(nameToHash("hide")); } g_stateManagerPtr->handleEvent(stateChange); return true; } } return false; } int main(int argc, char **argv) { //In desktop environment we have to initialize QGuiApplication #if defined(QSR_HOST_BUILD) QGuiApplication app(argc, argv); #else (void)argc; (void)argv; #endif static QSafeLayoutResourceReader layout("/layoutData/TellTales/TellTales.srl"); SafeWindow telltaleWindow(layout.size()); static SafeRenderer::StateManager stateManager(telltaleWindow, layout); for (SafeRenderer::quint32 i=0U;i