From 7081cca01654030f9a3b731cebf36e68590e3ed1 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 11 Jul 2018 14:03:23 +0200 Subject: Add GUI Decals API Signed-off-by: Clifford Wolf --- common/nextpnr.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index 37e193b9..0b41ff81 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -155,6 +155,12 @@ NEXTPNR_NAMESPACE_END NEXTPNR_NAMESPACE_BEGIN +struct DecalXY +{ + DecalId decal; + float x = 0, y = 0; +}; + struct BelPin { BelId bel; @@ -273,6 +279,60 @@ struct Context : Arch // -------------------------------------------------------------- + std::vector getFrameGraphics() const __attribute__ ((deprecated)) { + std::vector ret; + DecalXY decalxy = getFrameDecal(); + ret = getDecalGraphics(decalxy.decal); + for (auto &it : ret) { + it.x1 += decalxy.x; + it.x2 += decalxy.x; + it.y1 += decalxy.y; + it.y2 += decalxy.y; + } + return ret; + } + + std::vector getBelGraphics(BelId bel) const __attribute__ ((deprecated)) { + std::vector ret; + DecalXY decalxy = getBelDecal(bel); + ret = getDecalGraphics(decalxy.decal); + for (auto &it : ret) { + it.x1 += decalxy.x; + it.x2 += decalxy.x; + it.y1 += decalxy.y; + it.y2 += decalxy.y; + } + return ret; + } + + std::vector getWireGraphics(WireId wire) const __attribute__ ((deprecated)) { + std::vector ret; + DecalXY decalxy = getWireDecal(wire); + ret = getDecalGraphics(decalxy.decal); + for (auto &it : ret) { + it.x1 += decalxy.x; + it.x2 += decalxy.x; + it.y1 += decalxy.y; + it.y2 += decalxy.y; + } + return ret; + } + + std::vector getPipGraphics(PipId pip) const __attribute__ ((deprecated)) { + std::vector ret; + DecalXY decalxy = getPipDecal(pip); + ret = getDecalGraphics(decalxy.decal); + for (auto &it : ret) { + it.x1 += decalxy.x; + it.x2 += decalxy.x; + it.y1 += decalxy.y; + it.y2 += decalxy.y; + } + return ret; + } + + // -------------------------------------------------------------- + uint64_t rngstate = 0x3141592653589793; uint64_t rng64() -- cgit v1.2.3