aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-11 14:03:23 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-11 14:03:23 +0200
commit7081cca01654030f9a3b731cebf36e68590e3ed1 (patch)
tree8e01a719c3622a94aa77419117d72338b2746a71 /common/nextpnr.h
parent87d88048ac14de3fd70aca7e75f7b42ff424ece0 (diff)
downloadnextpnr-7081cca01654030f9a3b731cebf36e68590e3ed1.tar.gz
nextpnr-7081cca01654030f9a3b731cebf36e68590e3ed1.tar.bz2
nextpnr-7081cca01654030f9a3b731cebf36e68590e3ed1.zip
Add GUI Decals API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h60
1 files changed, 60 insertions, 0 deletions
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<GraphicElement> getFrameGraphics() const __attribute__ ((deprecated)) {
+ std::vector<GraphicElement> 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<GraphicElement> getBelGraphics(BelId bel) const __attribute__ ((deprecated)) {
+ std::vector<GraphicElement> 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<GraphicElement> getWireGraphics(WireId wire) const __attribute__ ((deprecated)) {
+ std::vector<GraphicElement> 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<GraphicElement> getPipGraphics(PipId pip) const __attribute__ ((deprecated)) {
+ std::vector<GraphicElement> 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()