diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-11 14:03:23 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-07-11 14:03:23 +0200 |
commit | 7081cca01654030f9a3b731cebf36e68590e3ed1 (patch) | |
tree | 8e01a719c3622a94aa77419117d72338b2746a71 /generic/arch.cc | |
parent | 87d88048ac14de3fd70aca7e75f7b42ff424ece0 (diff) | |
download | nextpnr-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 'generic/arch.cc')
-rw-r--r-- | generic/arch.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index 8f897604..b3854401 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -107,27 +107,32 @@ void Arch::addBelInout(IdString bel, IdString name, IdString wire) wires.at(wire).downhill_bel_pins.push_back(BelPin{bel, name}); } -void Arch::addFrameGraphic(const GraphicElement &graphic) +void Arch::addDecalGraphic(DecalId decal, const GraphicElement &graphic) { - frame_graphics.push_back(graphic); + decal_graphics[decal].push_back(graphic); +} + +void Arch::setFrameDecal(DecalXY decalxy) +{ + frame_decalxy = decalxy; frameGraphicsReload = true; } -void Arch::addWireGraphic(WireId wire, const GraphicElement &graphic) +void Arch::setWireDecal(WireId wire, DecalXY decalxy) { - wires.at(wire).graphics.push_back(graphic); + wires.at(wire).decalxy = decalxy; wireGraphicsReload.insert(wire); } -void Arch::addPipGraphic(PipId pip, const GraphicElement &graphic) +void Arch::setPipDecal(PipId pip, DecalXY decalxy) { - pips.at(pip).graphics.push_back(graphic); + pips.at(pip).decalxy = decalxy; pipGraphicsReload.insert(pip); } -void Arch::addBelGraphic(BelId bel, const GraphicElement &graphic) +void Arch::setBelDecal(BelId bel, DecalXY decalxy) { - bels.at(bel).graphics.push_back(graphic); + bels.at(bel).decalxy = decalxy; belGraphicsReload.insert(bel); } @@ -310,13 +315,15 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const // --------------------------------------------------------------- -const std::vector<GraphicElement> &Arch::getFrameGraphics() const { return frame_graphics; } +const std::vector<GraphicElement> &Arch::getDecalGraphics(DecalId decal) const { return decal_graphics.at(decal); } + +DecalXY Arch::getFrameDecal() const { return frame_decalxy; } -const std::vector<GraphicElement> &Arch::getBelGraphics(BelId bel) const { return bels.at(bel).graphics; } +DecalXY Arch::getBelDecal(BelId bel) const { return bels.at(bel).decalxy; } -const std::vector<GraphicElement> &Arch::getWireGraphics(WireId wire) const { return wires.at(wire).graphics; } +DecalXY Arch::getWireDecal(WireId wire) const { return wires.at(wire).decalxy; } -const std::vector<GraphicElement> &Arch::getPipGraphics(PipId pip) const { return pips.at(pip).graphics; } +DecalXY Arch::getPipDecal(PipId pip) const { return pips.at(pip).decalxy; } // --------------------------------------------------------------- |