#!/usr/bin/env python3 """Exercise the real LGFX touch conversion before the rendered reader targets.""" from pathlib import Path import subprocess import tempfile import unittest from test_replay_reset_integration import extract_braced ROOT = Path(__file__).resolve().parents[1] PREAMBLE = r''' #include #include #include #include #include ColorVal UIColor::window_bkg=0, UIColor::title_bkg=0, UIColor::title_txt=1; ColorVal UIColor::primary_txt=1, UIColor::secondary_txt=1, UIColor::warning_txt=1; ColorVal UIColor::popup_bkg=0, UIColor::popup_txt=1, UIColor::corp_blue=2; namespace lgfx { namespace v1 { struct touch_point_t { int x,y; }; } } struct Panel { int w=480,h=480,x=0,y=0; bool touched=true; int width() const { return w; } int height() const { return h; } int getTouch(lgfx::v1::touch_point_t* point) { point->x=x; point->y=y; return touched ? 1 : 0; } }; struct LGFXDisplay : DisplayDriver { Panel panel; Panel* display=&panel; // Retain these fields so this test also compiles the pre-fix implementation. int _coordinateScale=3; float _outputZoom=1.0f; struct Label { int x,y; std::string text; }; std::vector