I'm trying to create a custom TikZ shape consisting of a rectangle with small arrows on the border (representing signal input/output ports).
For the most part I can inherit from rectangle but I'm having some problems creating the input/output port arrows. Ideally, I would define anchors at the port locations and then use those to draw arrows in the backgroundpath section. Problem is, backgroundpath can't use normal anchors.
One option is to make the port locations saved anchors, but then I don't have access to \northeast and \southwest. Without those, I'm having troubles getting the anchors to be on the actual border.
The other option is just to duplicate the steps it takes to get to each anchor but I don't really like that.
Here is an example of what I would like to do:
\makeatletter
\pgfdeclareshape{MyShape}
{
\inheritsavedanchors[from=rectangle]
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{east}
% etc.
\inheritbeforebackgroundpath[from=rectangle]
\inheritforegroundpath[from=rectangle]
\inheritbeforeforegroundpath[from=rectangle]
\anchor{inputA}{%
\southwest
\pgf@y = \advance \pgf@y by 3mm
}
\backgroundpath
{
\pgfsetarrowsend{Latex[length=3pt]}
\pgfpathmoveto{\inputA}
\pgfpathlineto{\northeast}
\pgfusepath{stroke}
}
}
\makeatother
Note: I know that code won't work because inputA is just a normal anchor;