Corrected an error in the previous commit. Implemented a new form

of the "edit" command that takes an instance name as an argument.
This is the first of a small series of command extensions to
provide the capability to replace any command that is dependent on
the pointer position with an equivalent command that is not, for
the purpose of removing pointer and screen coordinate dependencies
from the log file created by "logcommands".
This commit is contained in:
Tim Edwards 2023-07-08 12:47:09 -04:00
parent 081058a41b
commit d3b314d877
3 changed files with 37 additions and 11 deletions

View File

@ -56,10 +56,12 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*
* Implement the "edit" command.
* Use the cell that is currently selected as the edit cell. If more than
* one cell is selected, use the point to choose between them.
* one cell is selected, use the point to choose between them. If the
* optional argument "<instname>" is provided, then edit the specified
* instance (if it exists in the current layout window).
*
* Usage:
* edit
* edit [<instname>]
*
* Results:
* None.
@ -82,13 +84,24 @@ CmdEdit(w, cmd)
TxCommand *cmd;
{
Rect area, pointArea;
CellUse *usave;
CellUse *usave, *use = NULL;
CellDef *csave;
int cmdEditRedisplayFunc(); /* Forward declaration. */
int cmdEditEnumFunc(); /* Forward declaration. */
bool noCurrentUse = FALSE;
if (cmd->tx_argc > 1)
if ((w != NULL) && (cmd->tx_argc == 2))
{
CellUse *rootUse;
SearchContext scx;
rootUse = (CellUse *)w->w_surfaceID;
bzero(&scx, sizeof(SearchContext));
DBTreeFindUse(cmd->tx_argv[1], rootUse, &scx);
use = scx.scx_use;
}
if ((use == NULL) && (cmd->tx_argc > 1))
{
TxError("Usage: edit\nMaybe you want the \"load\" command\n");
return;
@ -121,10 +134,18 @@ CmdEdit(w, cmd)
cmdFoundNewEdit = FALSE;
csave = EditRootDef;
usave = EditCellUse;
EditCellUse = NULL;
(void) SelEnumCells(FALSE, (bool *) NULL, (SearchContext *) NULL,
cmdEditEnumFunc, (ClientData) &pointArea);
if (use == NULL)
{
EditCellUse = NULL;
SelEnumCells(FALSE, (bool *) NULL, (SearchContext *) NULL,
cmdEditEnumFunc, (ClientData) &pointArea);
}
else
{
EditCellUse = use;
cmdFoundNewEdit = TRUE;
}
if (EditCellUse == (CellUse *)NULL)
{

View File

@ -20,7 +20,7 @@
<H2>edit</H2>
<HR>
Use selected cell as new edit cell
Use selected cell as new edit cell, or specify cell to edit.
<HR>
<H3>Shortcuts:</H3>
@ -30,12 +30,17 @@ Use selected cell as new edit cell
<H3>Usage:</H3>
<BLOCKQUOTE>
<B>edit</B> <BR><BR>
<B>edit</B> [<I>instance</I>]<BR><BR>
</BLOCKQUOTE>
<H3>Summary:</H3>
<BLOCKQUOTE>
The <B>edit</B> command makes the selected cell the new edit cell.
With no arguments, the <B>edit</B> command makes the selected cell the
new edit cell. If more than one cell is selected, then the one closest
to the pointer position is used. <BR><BR>
With argument <I>instance</I>, makes the instance named <I>instance</I>
the new edit cell, if <I>instance</I> exists and is in the current layout
window.
</BLOCKQUOTE>
<H3>Implementation Notes:</H3>

View File

@ -547,7 +547,7 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice)
if (nn1 && nn2 && (nn1->efnn_port >= 0) && (nn2->efnn_port >= 0) &&
(nn1->efnn_port != nn2->efnn_port))
{
equalByCase = FALSE;
bool equalByCase = FALSE;
if (isspice)
{
/* If ports have the same name under the assumption of