dbwind: convert K&R function definitions to ANSI C
Convert the old-style (K&R) function definitions in dbwind/ to ANSI C prototypes, formatted in the project's convention: the return type on its own line and each parameter on its own line, indented four spaces, with the original parameter comments retained. Updates dbwind.h, including a prototype for the combined DBWloadWindow declaration. Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
4f8c244876
commit
147ac45285
|
|
@ -153,14 +153,14 @@ extern int dbwWindowFunc(), dbwChangedFunc();
|
|||
*/
|
||||
|
||||
void
|
||||
DBWredisplay(w, rootArea, clipArea)
|
||||
MagWindow *w; /* Window some of whose contents are to be
|
||||
DBWredisplay(
|
||||
MagWindow *w, /* Window some of whose contents are to be
|
||||
* redisplayed.
|
||||
*/
|
||||
Rect *rootArea; /* The area that must be redisplayed, in
|
||||
Rect *rootArea, /* The area that must be redisplayed, in
|
||||
* root cell coordinates.
|
||||
*/
|
||||
Rect *clipArea; /* The screen area that we should clip to
|
||||
Rect *clipArea) /* The screen area that we should clip to
|
||||
*/
|
||||
{
|
||||
int i;
|
||||
|
|
@ -572,10 +572,10 @@ DBWredisplay(w, rootArea, clipArea)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwPaintFunc(tile, dinfo, cxp)
|
||||
Tile *tile; /* Tile to be redisplayed. */
|
||||
TileType dinfo; /* Split tile information */
|
||||
TreeContext *cxp; /* From DBTreeSrTiles */
|
||||
dbwPaintFunc(
|
||||
Tile *tile, /* Tile to be redisplayed. */
|
||||
TileType dinfo, /* Split tile information */
|
||||
TreeContext *cxp) /* From DBTreeSrTiles */
|
||||
{
|
||||
SearchContext *scx = cxp->tc_scx;
|
||||
/* Contains pointer to use containing def
|
||||
|
|
@ -683,22 +683,21 @@ dbwPaintFunc(tile, dinfo, cxp)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWDrawLabel(label, rect, pos, style, labelSize, sizeBox)
|
||||
Label *label; /* Text to be displayed. */
|
||||
Rect *rect; /* labrect, clipped to the visible window
|
||||
DBWDrawLabel(
|
||||
Label *label, /* Text to be displayed. */
|
||||
Rect *rect, /* labrect, clipped to the visible window
|
||||
*/
|
||||
int pos; /* Position of text relative to rect (e.g.
|
||||
int pos, /* Position of text relative to rect (e.g.
|
||||
* GEO_NORTH) in screen coordinates.
|
||||
*/
|
||||
int style; /* Style to use for redisplay; if -1 then
|
||||
int style, /* Style to use for redisplay; if -1 then
|
||||
* this has already been set by the caller
|
||||
* and we shouldn't call GrSetStuff.
|
||||
*/
|
||||
|
||||
int labelSize; /* Size to use for drawing labels. If < 0 then
|
||||
int labelSize, /* Size to use for drawing labels. If < 0 then
|
||||
* no text is drawn: only the box.
|
||||
*/
|
||||
Rect *sizeBox; /* Expanded if necessary to include the
|
||||
Rect *sizeBox) /* Expanded if necessary to include the
|
||||
* screen area of the text for this label.
|
||||
*/
|
||||
{
|
||||
|
|
@ -783,11 +782,11 @@ DBWDrawLabel(label, rect, pos, style, labelSize, sizeBox)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWDrawFontLabel(label, window, trans, style)
|
||||
Label *label;
|
||||
MagWindow *window;
|
||||
Transform *trans;
|
||||
int style; /* If -1, style is already set */
|
||||
DBWDrawFontLabel(
|
||||
Label *label,
|
||||
MagWindow *window,
|
||||
Transform *trans,
|
||||
int style) /* If -1, style is already set */
|
||||
{
|
||||
Point *p, newcorner, scrncorners[4], labOrigin;
|
||||
Rect rootArea, labrect;
|
||||
|
|
@ -923,14 +922,14 @@ DBWDrawFontLabel(label, window, trans, style)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwLabelFunc(scx, label, tpath, clientData)
|
||||
SearchContext *scx; /* Contains pointer to use containing def in
|
||||
dbwLabelFunc(
|
||||
SearchContext *scx, /* Contains pointer to use containing def in
|
||||
* which label appears, and transform to
|
||||
* screen coordinates.
|
||||
*/
|
||||
Label *label; /* Label to be displayed. */
|
||||
TerminalPath *tpath; /* Contains pointer to full pathname of label */
|
||||
ClientData clientData; /* Used for mask for dbw_visibleLayers */
|
||||
Label *label, /* Label to be displayed. */
|
||||
TerminalPath *tpath, /* Contains pointer to full pathname of label */
|
||||
ClientData clientData) /* Used for mask for dbw_visibleLayers */
|
||||
{
|
||||
Rect labRect, tmp;
|
||||
int screenPos, screenRot, newStyle;
|
||||
|
|
@ -1027,8 +1026,8 @@ dbwLabelFunc(scx, label, tpath, clientData)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwBBoxFunc(scx)
|
||||
SearchContext *scx; /* Describes context of cell. */
|
||||
dbwBBoxFunc(
|
||||
SearchContext *scx) /* Describes context of cell. */
|
||||
{
|
||||
Rect r, r2;
|
||||
char idName[100];
|
||||
|
|
@ -1077,10 +1076,10 @@ dbwBBoxFunc(scx)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwTileFunc(tile, dinfo, clientdata)
|
||||
Tile *tile; /* A tile to be redisplayed. */
|
||||
TileType dinfo; /* Split tile information (unused) */
|
||||
ClientData clientdata; /* (unused) */
|
||||
dbwTileFunc(
|
||||
Tile *tile, /* A tile to be redisplayed. */
|
||||
TileType dinfo, /* Split tile information (unused) */
|
||||
ClientData clientdata) /* (unused) */
|
||||
{
|
||||
Rect r, r2;
|
||||
int xoffset, yoffset;
|
||||
|
|
@ -1292,13 +1291,13 @@ static TileTypeBitMask *dbwLayersChanged;
|
|||
/* DBWAreaChanged's "layers" parameter. */
|
||||
|
||||
void
|
||||
DBWAreaChanged(cellDef, defArea, expandMask, layers)
|
||||
CellDef *cellDef; /* The cell definition that was modified. */
|
||||
Rect *defArea; /* The area of the definition that changed. */
|
||||
int expandMask; /* We're only interested these windows.
|
||||
DBWAreaChanged(
|
||||
CellDef *cellDef, /* The cell definition that was modified. */
|
||||
Rect *defArea, /* The area of the definition that changed. */
|
||||
int expandMask, /* We're only interested these windows.
|
||||
* Use DBW_ALLWINDOWS for all windows.
|
||||
*/
|
||||
TileTypeBitMask *layers; /* Indicates which layers were modified. If
|
||||
TileTypeBitMask *layers) /* Indicates which layers were modified. If
|
||||
* NULL, it means that labels were deleted
|
||||
* from defArea in addition to paint. We'll
|
||||
* have to redisplay a larger area in order
|
||||
|
|
@ -1443,9 +1442,9 @@ DBWAreaChanged(cellDef, defArea, expandMask, layers)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwChangedFunc(w, area)
|
||||
MagWindow *w; /* Window in which to record area. */
|
||||
Rect *area; /* (Client data) Area to be redisplayed, in
|
||||
dbwChangedFunc(
|
||||
MagWindow *w, /* Window in which to record area. */
|
||||
Rect *area) /* (Client data) Area to be redisplayed, in
|
||||
* coordinates of the root definition.
|
||||
*/
|
||||
{
|
||||
|
|
@ -1523,10 +1522,10 @@ dbwChangedFunc(w, area)
|
|||
extern int dbwLabelChangedFunc(); /* Function to call for each label. */
|
||||
|
||||
void
|
||||
DBWLabelChanged(cellDef, lab, mask)
|
||||
CellDef *cellDef; /* Cell definition containing label. */
|
||||
Label *lab; /* The label structure */
|
||||
int mask; /* Mask of windows where changes should be
|
||||
DBWLabelChanged(
|
||||
CellDef *cellDef, /* Cell definition containing label. */
|
||||
Label *lab, /* The label structure */
|
||||
int mask) /* Mask of windows where changes should be
|
||||
* reflected (DBW_ALLWINDOWS selects all
|
||||
* windows, and is usually the right value.)
|
||||
*/
|
||||
|
|
@ -1596,9 +1595,9 @@ DBWLabelChanged(cellDef, lab, mask)
|
|||
}
|
||||
|
||||
int
|
||||
dbwLabelChangedFunc(w, lab)
|
||||
MagWindow *w; /* Window in which label is displayed. */
|
||||
Label *lab; /* Label being changed. */
|
||||
dbwLabelChangedFunc(
|
||||
MagWindow *w, /* Window in which label is displayed. */
|
||||
Label *lab) /* Label being changed. */
|
||||
{
|
||||
Rect screenArea, textArea;
|
||||
int size;
|
||||
|
|
@ -1685,8 +1684,8 @@ DBWTechInitStyles()
|
|||
*/
|
||||
|
||||
int
|
||||
DBWTechParseStyle(stylestr)
|
||||
char *stylestr;
|
||||
DBWTechParseStyle(
|
||||
char *stylestr)
|
||||
{
|
||||
int sidx, style;
|
||||
|
||||
|
|
@ -1724,10 +1723,10 @@ DBWTechParseStyle(stylestr)
|
|||
*/
|
||||
|
||||
bool
|
||||
DBWTechAddStyle(sectionName, argc, argv)
|
||||
char *sectionName;
|
||||
int argc;
|
||||
char *argv[];
|
||||
DBWTechAddStyle(
|
||||
char *sectionName,
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
TileType t, r;
|
||||
TileTypeBitMask *rMask;
|
||||
|
|
|
|||
|
|
@ -101,10 +101,10 @@ static CellDef *dbwelemRootDef; /* To pass root cell definition from
|
|||
*/
|
||||
|
||||
void
|
||||
AppendString(oldstr, newstr, postfix)
|
||||
char **oldstr;
|
||||
const char *newstr;
|
||||
const char *postfix;
|
||||
AppendString(
|
||||
char **oldstr,
|
||||
const char *newstr,
|
||||
const char *postfix)
|
||||
{
|
||||
char *tmpstr;
|
||||
int olen = 0;
|
||||
|
|
@ -175,10 +175,10 @@ AppendFlag(
|
|||
*/
|
||||
|
||||
char *
|
||||
DBWPrintElements(cellDef, flagmask, reducer)
|
||||
CellDef *cellDef;
|
||||
unsigned char flagmask;
|
||||
int reducer;
|
||||
DBWPrintElements(
|
||||
CellDef *cellDef,
|
||||
unsigned char flagmask,
|
||||
int reducer)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashSearch hs;
|
||||
|
|
@ -287,8 +287,9 @@ DBWPrintElements(cellDef, flagmask, reducer)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWScaleElements(n, d)
|
||||
int n, d;
|
||||
DBWScaleElements(
|
||||
int n,
|
||||
int d)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashSearch hs;
|
||||
|
|
@ -333,9 +334,9 @@ DBWScaleElements(n, d)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementRedraw(window, plane)
|
||||
MagWindow *window; /* Window in which to redraw. */
|
||||
Plane *plane; /* Non-space tiles on this plane mark what
|
||||
DBWElementRedraw(
|
||||
MagWindow *window, /* Window in which to redraw. */
|
||||
Plane *plane) /* Non-space tiles on this plane mark what
|
||||
* needs to be redrawn.
|
||||
*/
|
||||
{
|
||||
|
|
@ -495,9 +496,9 @@ DBWElementRedraw(window, plane)
|
|||
*/
|
||||
|
||||
void
|
||||
dbwElementUndraw(mw, elem)
|
||||
MagWindow *mw;
|
||||
DBWElement *elem; /* The element to erase */
|
||||
dbwElementUndraw(
|
||||
MagWindow *mw,
|
||||
DBWElement *elem) /* The element to erase */
|
||||
{
|
||||
CellDef *windowRoot;
|
||||
Rect screenArea, textArea;
|
||||
|
|
@ -567,7 +568,9 @@ dbwElementUndraw(mw, elem)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementDelete(MagWindow *w, char *name)
|
||||
DBWElementDelete(
|
||||
MagWindow *w,
|
||||
char *name)
|
||||
{
|
||||
DBWElement *elem;
|
||||
CellDef *currentRoot;
|
||||
|
|
@ -669,8 +672,8 @@ DBWElementNames()
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementInbox(area)
|
||||
Rect *area;
|
||||
DBWElementInbox(
|
||||
Rect *area)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashSearch hs;
|
||||
|
|
@ -726,14 +729,14 @@ DBWElementInbox(area)
|
|||
/* Set up everything is generic to all element types */
|
||||
|
||||
DBWElement *
|
||||
DBWElementAdd(w, name, area, cellDef, style)
|
||||
MagWindow *w;
|
||||
char *name; /* Name of this element for the hash table */
|
||||
Rect *area; /* The area of the element */
|
||||
CellDef *cellDef; /* The cellDef in whose coordinates area
|
||||
DBWElementAdd(
|
||||
MagWindow *w,
|
||||
char *name, /* Name of this element for the hash table */
|
||||
Rect *area, /* The area of the element */
|
||||
CellDef *cellDef, /* The cellDef in whose coordinates area
|
||||
* is given.
|
||||
*/
|
||||
int style; /* An initial display style to use */
|
||||
int style) /* An initial display style to use */
|
||||
{
|
||||
Transform transform;
|
||||
DBWElement *elem;
|
||||
|
|
@ -779,14 +782,14 @@ DBWElementAdd(w, name, area, cellDef, style)
|
|||
}
|
||||
|
||||
void
|
||||
DBWElementAddRect(w, name, area, cellDef, style)
|
||||
MagWindow *w;
|
||||
char *name; /* Name of this element for the hash table */
|
||||
Rect *area; /* The area to be highlighted. */
|
||||
CellDef *cellDef; /* The cellDef in whose coordinates area
|
||||
DBWElementAddRect(
|
||||
MagWindow *w,
|
||||
char *name, /* Name of this element for the hash table */
|
||||
Rect *area, /* The area to be highlighted. */
|
||||
CellDef *cellDef, /* The cellDef in whose coordinates area
|
||||
* is given.
|
||||
*/
|
||||
int style; /* An initial display style to use */
|
||||
int style) /* An initial display style to use */
|
||||
{
|
||||
DBWElement *elem;
|
||||
|
||||
|
|
@ -796,14 +799,14 @@ DBWElementAddRect(w, name, area, cellDef, style)
|
|||
}
|
||||
|
||||
void
|
||||
DBWElementAddLine(w, name, area, cellDef, style)
|
||||
MagWindow *w;
|
||||
char *name; /* Name of this element for the hash table */
|
||||
Rect *area; /* The area to be highlighted. */
|
||||
CellDef *cellDef; /* The cellDef in whose coordinates area
|
||||
DBWElementAddLine(
|
||||
MagWindow *w,
|
||||
char *name, /* Name of this element for the hash table */
|
||||
Rect *area, /* The area to be highlighted. */
|
||||
CellDef *cellDef, /* The cellDef in whose coordinates area
|
||||
* is given.
|
||||
*/
|
||||
int style; /* An initial display style to use */
|
||||
int style) /* An initial display style to use */
|
||||
{
|
||||
DBWElement *elem;
|
||||
|
||||
|
|
@ -813,15 +816,16 @@ DBWElementAddLine(w, name, area, cellDef, style)
|
|||
}
|
||||
|
||||
void
|
||||
DBWElementAddText(w, name, x, y, text, cellDef, style)
|
||||
MagWindow *w;
|
||||
char *name; /* Name of this element for the hash table */
|
||||
int x, y; /* Point of origin (x, y coordinates) */
|
||||
char *text; /* The text of the label */
|
||||
CellDef *cellDef; /* The cellDef in whose coordinates area
|
||||
DBWElementAddText(
|
||||
MagWindow *w,
|
||||
char *name, /* Name of this element for the hash table */
|
||||
int x,
|
||||
int y,
|
||||
char *text, /* The text of the label */
|
||||
CellDef *cellDef, /* The cellDef in whose coordinates area
|
||||
* is given.
|
||||
*/
|
||||
int style; /* An initial display style to use */
|
||||
int style) /* An initial display style to use */
|
||||
{
|
||||
DBWElement *elem;
|
||||
Rect area;
|
||||
|
|
@ -847,12 +851,12 @@ DBWElementAddText(w, name, x, y, text, cellDef, style)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwelemGetTransform(use, transform, cdarg)
|
||||
CellUse *use; /* A root use that is an ancestor
|
||||
dbwelemGetTransform(
|
||||
CellUse *use, /* A root use that is an ancestor
|
||||
* of cellDef in DBWElementAdd.
|
||||
*/
|
||||
Transform *transform; /* Transform up from cellDef to use. */
|
||||
Transform *cdarg; /* Place to store transform from
|
||||
Transform *transform, /* Transform up from cellDef to use. */
|
||||
Transform *cdarg) /* Place to store transform from
|
||||
* cellDef to its root def.
|
||||
*/
|
||||
{
|
||||
|
|
@ -869,9 +873,9 @@ dbwelemGetTransform(use, transform, cdarg)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dbwElementAlways1(w, clientData)
|
||||
MagWindow *w; /* UNUSED */
|
||||
ClientData clientData; /* UNUSED */
|
||||
dbwElementAlways1(
|
||||
MagWindow *w, /* UNUSED */
|
||||
ClientData clientData) /* UNUSED */
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -894,7 +898,10 @@ dbwElementAlways1(w, clientData)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementText(MagWindow *w, char *ename, char *text)
|
||||
DBWElementText(
|
||||
MagWindow *w,
|
||||
char *ename,
|
||||
char *text)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashEntry *entry;
|
||||
|
|
@ -949,7 +956,10 @@ DBWElementText(MagWindow *w, char *ename, char *text)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementParseFlags(MagWindow *w, char *ename, char *flagstr)
|
||||
DBWElementParseFlags(
|
||||
MagWindow *w,
|
||||
char *ename,
|
||||
char *flagstr)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashEntry *entry;
|
||||
|
|
@ -1097,7 +1107,11 @@ DBWElementParseFlags(MagWindow *w, char *ename, char *flagstr)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementStyle(MagWindow *w, char *ename, int style, bool add)
|
||||
DBWElementStyle(
|
||||
MagWindow *w,
|
||||
char *ename,
|
||||
int style,
|
||||
bool add)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashEntry *entry;
|
||||
|
|
@ -1206,7 +1220,10 @@ DBWElementStyle(MagWindow *w, char *ename, int style, bool add)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementPos(MagWindow *w, char *ename, Rect *crect)
|
||||
DBWElementPos(
|
||||
MagWindow *w,
|
||||
char *ename,
|
||||
Rect *crect)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashEntry *entry;
|
||||
|
|
@ -1273,8 +1290,8 @@ DBWElementPos(MagWindow *w, char *ename, Rect *crect)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWElementClearDef(cellDef)
|
||||
CellDef *cellDef;
|
||||
DBWElementClearDef(
|
||||
CellDef *cellDef)
|
||||
{
|
||||
DBWElement *elem;
|
||||
HashEntry *entry;
|
||||
|
|
|
|||
|
|
@ -120,9 +120,9 @@ static CellDef *dbwfbRootDef; /* To pass root cell definition from
|
|||
*/
|
||||
|
||||
void
|
||||
DBWFeedbackRedraw(window, plane)
|
||||
MagWindow *window; /* Window in which to redraw. */
|
||||
Plane *plane; /* Non-space tiles on this plane mark what
|
||||
DBWFeedbackRedraw(
|
||||
MagWindow *window, /* Window in which to redraw. */
|
||||
Plane *plane) /* Non-space tiles on this plane mark what
|
||||
* needs to be redrawn.
|
||||
*/
|
||||
{
|
||||
|
|
@ -276,8 +276,8 @@ dbwFeedbackAlways1(
|
|||
*/
|
||||
|
||||
void
|
||||
DBWFeedbackClear(text)
|
||||
char *text;
|
||||
DBWFeedbackClear(
|
||||
char *text)
|
||||
{
|
||||
int i, oldCount;
|
||||
Feedback *fb, *fl, *fe;
|
||||
|
|
@ -377,13 +377,13 @@ DBWFeedbackClear(text)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWFeedbackAdd(area, text, cellDef, scaleFactor, style)
|
||||
Rect *area; /* The area to be highlighted. */
|
||||
char *text; /* Text associated with the area. */
|
||||
CellDef *cellDef; /* The cellDef in whose coordinates area
|
||||
DBWFeedbackAdd(
|
||||
Rect *area, /* The area to be highlighted. */
|
||||
char *text, /* Text associated with the area. */
|
||||
CellDef *cellDef, /* The cellDef in whose coordinates area
|
||||
* is given.
|
||||
*/
|
||||
int scaleFactor; /* The coordinates provided for feedback
|
||||
int scaleFactor, /* The coordinates provided for feedback
|
||||
* areas are divided by this to produce
|
||||
* coordinates in Magic database units.
|
||||
* This will probably be 1 most of the time.
|
||||
|
|
@ -394,7 +394,7 @@ DBWFeedbackAdd(area, text, cellDef, scaleFactor, style)
|
|||
* exactly the same coordinates as other Magic
|
||||
* stuff.
|
||||
*/
|
||||
int style; /* A display style to use for the feedback.
|
||||
int style) /* A display style to use for the feedback.
|
||||
* Use one of:
|
||||
* STYLE_OUTLINEHIGHLIGHTS: solid outlines
|
||||
* STYLE_DOTTEDHIGHLIGHTS: dotted outlines
|
||||
|
|
@ -505,12 +505,12 @@ DBWFeedbackAdd(area, text, cellDef, scaleFactor, style)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwfbGetTransform(use, transform, cdarg)
|
||||
CellUse *use; /* A root use that is an ancestor
|
||||
dbwfbGetTransform(
|
||||
CellUse *use, /* A root use that is an ancestor
|
||||
* of cellDef in DBWFeedbackAdd.
|
||||
*/
|
||||
Transform *transform; /* Transform up from cellDef to use. */
|
||||
Transform *cdarg; /* Place to store transform from
|
||||
Transform *transform, /* Transform up from cellDef to use. */
|
||||
Transform *cdarg) /* Place to store transform from
|
||||
* cellDef to its root def.
|
||||
*/
|
||||
{
|
||||
|
|
@ -533,9 +533,9 @@ dbwfbGetTransform(use, transform, cdarg)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dbwfbWindFunc(w, clientData)
|
||||
MagWindow *w; /* UNUSED */
|
||||
ClientData clientData; /* UNUSED */
|
||||
dbwfbWindFunc(
|
||||
MagWindow *w, /* UNUSED */
|
||||
ClientData clientData) /* UNUSED */
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -630,18 +630,18 @@ DBWFeedbackShow()
|
|||
*/
|
||||
|
||||
char *
|
||||
DBWFeedbackNth(nth, area, pRootDef, pStyle)
|
||||
int nth; /* Selects which feedback area to return
|
||||
DBWFeedbackNth(
|
||||
int nth, /* Selects which feedback area to return
|
||||
* stuff from. (0 <= nth < DBWFeedbackCount)
|
||||
*/
|
||||
Rect *area; /* To be filled in with area of feedback, in
|
||||
Rect *area, /* To be filled in with area of feedback, in
|
||||
* rounded-outward Magic coordinates.
|
||||
*/
|
||||
CellDef **pRootDef; /* *pRootDef gets filled in with root def for
|
||||
CellDef **pRootDef, /* *pRootDef gets filled in with root def for
|
||||
* this feedback area. If pRootDef is NULL,
|
||||
* nothing is touched.
|
||||
*/
|
||||
int *pStyle; /* *pStyle gets filled in with the display
|
||||
int *pStyle) /* *pStyle gets filled in with the display
|
||||
* style for this feedback area. If NULL,
|
||||
* nothing is touched.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -81,10 +81,10 @@ static int (*dbwButtonHandler)() = NULL;
|
|||
*/
|
||||
|
||||
bool
|
||||
DBWcreate(window, argc, argv)
|
||||
MagWindow *window;
|
||||
int argc;
|
||||
char *argv[];
|
||||
DBWcreate(
|
||||
MagWindow *window,
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
int bitMask, newBitMask, expand;
|
||||
DBWclientRec *crec;
|
||||
|
|
@ -171,8 +171,8 @@ DBWcreate(window, argc, argv)
|
|||
*/
|
||||
|
||||
bool
|
||||
DBWdelete(window)
|
||||
MagWindow *window;
|
||||
DBWdelete(
|
||||
MagWindow *window)
|
||||
{
|
||||
DBWclientRec *cr;
|
||||
|
||||
|
|
@ -207,9 +207,9 @@ DBWdelete(window)
|
|||
*/
|
||||
|
||||
int
|
||||
dbwLoadFunc(w, clientData)
|
||||
MagWindow *w; /* A window found in the search. */
|
||||
MagWindow *clientData; /* Window to ignore (passed as ClientData). */
|
||||
dbwLoadFunc(
|
||||
MagWindow *w, /* A window found in the search. */
|
||||
MagWindow *clientData) /* Window to ignore (passed as ClientData). */
|
||||
{
|
||||
if (w == clientData) return 0;
|
||||
if (((CellUse *) w->w_surfaceID)->cu_def == EditRootDef)
|
||||
|
|
@ -237,8 +237,8 @@ dbwLoadFunc(w, clientData)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWreload(name)
|
||||
char *name;
|
||||
DBWreload(
|
||||
char *name)
|
||||
{
|
||||
int dbwReloadFunc();
|
||||
|
||||
|
|
@ -247,9 +247,9 @@ DBWreload(name)
|
|||
}
|
||||
|
||||
int
|
||||
dbwReloadFunc(w, name)
|
||||
MagWindow *w;
|
||||
char *name;
|
||||
dbwReloadFunc(
|
||||
MagWindow *w,
|
||||
char *name)
|
||||
{
|
||||
DBWloadWindow(w, name, DBW_LOAD_IGNORE_TECH);
|
||||
return (0);
|
||||
|
|
@ -283,10 +283,10 @@ dbwReloadFunc(w, name)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWloadWindow(window, name, flags)
|
||||
MagWindow *window; /* Identifies window to which cell is to be bound */
|
||||
char *name; /* Name of new cell to be bound to this window */
|
||||
unsigned char flags; /* See flags below */
|
||||
DBWloadWindow(
|
||||
MagWindow *window, /* Identifies window to which cell is to be bound */
|
||||
char *name, /* Name of new cell to be bound to this window */
|
||||
unsigned char flags) /* See flags below */
|
||||
{
|
||||
CellDef *newEditDef, *deleteDef;
|
||||
CellUse *newEditUse;
|
||||
|
|
@ -623,9 +623,9 @@ DBWloadWindow(window, name, flags)
|
|||
*/
|
||||
|
||||
int
|
||||
UnexpandFunc(use, windowMask)
|
||||
CellUse *use; /* Use that was just unexpanded. */
|
||||
int windowMask; /* Window where it was unexpanded. */
|
||||
UnexpandFunc(
|
||||
CellUse *use, /* Use that was just unexpanded. */
|
||||
int windowMask) /* Window where it was unexpanded. */
|
||||
{
|
||||
if (use->cu_parent == NULL) return 0;
|
||||
DBWAreaChanged(use->cu_parent, &use->cu_bbox, windowMask,
|
||||
|
|
@ -980,9 +980,9 @@ DBWPrintCIFSqValue(int value, /* value to print, in internal units */
|
|||
*/
|
||||
|
||||
void
|
||||
DBWcommands(w, cmd)
|
||||
MagWindow *w;
|
||||
TxCommand *cmd;
|
||||
DBWcommands(
|
||||
MagWindow *w,
|
||||
TxCommand *cmd)
|
||||
{
|
||||
int cmdNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -111,13 +111,13 @@ extern int DBWToolDraw();
|
|||
*/
|
||||
|
||||
MagWindow *
|
||||
toolFindPoint(p, rootPoint, rootArea)
|
||||
Point *p; /* The point to find, in the current window. */
|
||||
Point *rootPoint; /* Modified to contain coordinates of point
|
||||
toolFindPoint(
|
||||
Point *p, /* The point to find, in the current window. */
|
||||
Point *rootPoint, /* Modified to contain coordinates of point
|
||||
* in root cell coordinates. Is unchanged
|
||||
* if NULL is returned.
|
||||
*/
|
||||
Rect *rootArea; /* Modified to contain box around point. Is
|
||||
Rect *rootArea) /* Modified to contain box around point. Is
|
||||
* unchanged when NULL is returned.
|
||||
*/
|
||||
{
|
||||
|
|
@ -158,12 +158,12 @@ toolFindPoint(p, rootPoint, rootArea)
|
|||
*/
|
||||
|
||||
MagWindow *
|
||||
ToolGetPoint(rootPoint, rootArea)
|
||||
Point *rootPoint; /* Modified to contain coordinates of point
|
||||
ToolGetPoint(
|
||||
Point *rootPoint, /* Modified to contain coordinates of point
|
||||
* in root cell coordinates. Is unchanged
|
||||
* if NULL is returned.
|
||||
*/
|
||||
Rect *rootArea; /* Modified to contain box around point. Is
|
||||
Rect *rootArea) /* Modified to contain box around point. Is
|
||||
* unchanged when NULL is returned.
|
||||
*/
|
||||
{
|
||||
|
|
@ -193,9 +193,9 @@ ToolGetPoint(rootPoint, rootArea)
|
|||
*/
|
||||
|
||||
bool
|
||||
ToolGetBox(rootDef, rootArea)
|
||||
CellDef **rootDef; /* Filled in with the root def of the box */
|
||||
Rect *rootArea; /* Filled in with area of box. Will be
|
||||
ToolGetBox(
|
||||
CellDef **rootDef, /* Filled in with the root def of the box */
|
||||
Rect *rootArea) /* Filled in with area of box. Will be
|
||||
* unchanged when NULL is returned.
|
||||
*/
|
||||
{
|
||||
|
|
@ -210,9 +210,9 @@ ToolGetBox(rootDef, rootArea)
|
|||
/* ToolScaleBox --- Simple scaling of the root area box, no update needed */
|
||||
|
||||
void
|
||||
ToolScaleBox(scalen, scaled)
|
||||
int scalen;
|
||||
int scaled;
|
||||
ToolScaleBox(
|
||||
int scalen,
|
||||
int scaled)
|
||||
{
|
||||
DBScalePoint(&boxRootArea.r_ll, scalen, scaled);
|
||||
DBScalePoint(&boxRootArea.r_ur, scalen, scaled);
|
||||
|
|
@ -245,11 +245,11 @@ ToolScaleBox(scalen, scaled)
|
|||
static int toolMask; /* Shared between these two routines. */
|
||||
|
||||
MagWindow *
|
||||
ToolGetBoxWindow(rootArea, pMask)
|
||||
Rect *rootArea; /* Filled in with area of box. Will be
|
||||
ToolGetBoxWindow(
|
||||
Rect *rootArea, /* Filled in with area of box. Will be
|
||||
* unchanged when NULL is returned.
|
||||
*/
|
||||
int *pMask; /* Filled in with mask of all windows
|
||||
int *pMask) /* Filled in with mask of all windows
|
||||
* containing box.
|
||||
*/
|
||||
{
|
||||
|
|
@ -275,9 +275,9 @@ ToolGetBoxWindow(rootArea, pMask)
|
|||
}
|
||||
|
||||
int
|
||||
toolWindowSave(window, clientData)
|
||||
MagWindow *window; /* Window that matched in some search. */
|
||||
ClientData clientData; /* Contains the address of a location
|
||||
toolWindowSave(
|
||||
MagWindow *window, /* Window that matched in some search. */
|
||||
ClientData clientData) /* Contains the address of a location
|
||||
* to be filled in with the window address.
|
||||
*/
|
||||
{
|
||||
|
|
@ -311,8 +311,8 @@ toolWindowSave(window, clientData)
|
|||
*/
|
||||
|
||||
bool
|
||||
ToolGetEditBox(rect)
|
||||
Rect *rect;
|
||||
ToolGetEditBox(
|
||||
Rect *rect)
|
||||
{
|
||||
CellDef *editDef;
|
||||
|
||||
|
|
@ -370,9 +370,8 @@ ToolGetEditBox(rect)
|
|||
*/
|
||||
|
||||
int
|
||||
ToolGetCorner(screenPoint)
|
||||
Point *screenPoint;
|
||||
|
||||
ToolGetCorner(
|
||||
Point *screenPoint)
|
||||
{
|
||||
Point p;
|
||||
MagWindow *w;
|
||||
|
|
@ -447,9 +446,9 @@ dbwCrosshairInit()
|
|||
*/
|
||||
|
||||
void
|
||||
dbwRecordCrosshairYPos(def, erase)
|
||||
CellDef *def;
|
||||
bool erase; /* TRUE means crossair is being erased from its
|
||||
dbwRecordCrosshairYPos(
|
||||
CellDef *def,
|
||||
bool erase) /* TRUE means crossair is being erased from its
|
||||
* current position. FALSE means the crosshair
|
||||
* is being added at a new position.
|
||||
*/
|
||||
|
|
@ -463,9 +462,9 @@ dbwRecordCrosshairYPos(def, erase)
|
|||
}
|
||||
|
||||
void
|
||||
dbwRecordCrosshairXPos(def, erase)
|
||||
CellDef *def;
|
||||
bool erase; /* TRUE means crossair is being erased from its
|
||||
dbwRecordCrosshairXPos(
|
||||
CellDef *def,
|
||||
bool erase) /* TRUE means crossair is being erased from its
|
||||
* current position. FALSE means the crosshair
|
||||
* is being added at a new position.
|
||||
*/
|
||||
|
|
@ -497,9 +496,9 @@ dbwRecordCrosshairXPos(def, erase)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWDrawCrosshair(window, plane)
|
||||
MagWindow *window; /* Window in which to redraw box. */
|
||||
Plane *plane; /* Non-space tiles on this plane indicate
|
||||
DBWDrawCrosshair(
|
||||
MagWindow *window, /* Window in which to redraw box. */
|
||||
Plane *plane) /* Non-space tiles on this plane indicate
|
||||
* which highlight areas must be redrawn.
|
||||
*/
|
||||
{
|
||||
|
|
@ -532,9 +531,9 @@ DBWDrawCrosshair(window, plane)
|
|||
/* DBWScaleCrosshair --- Simple scaling of the crosshair point, no update needed */
|
||||
|
||||
void
|
||||
DBWScaleCrosshair(scalen, scaled)
|
||||
int scalen;
|
||||
int scaled;
|
||||
DBWScaleCrosshair(
|
||||
int scalen,
|
||||
int scaled)
|
||||
{
|
||||
DBScalePoint(&(curCrosshair.pos), scalen, scaled);
|
||||
}
|
||||
|
|
@ -554,9 +553,9 @@ DBWScaleCrosshair(scalen, scaled)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWSetCrosshair(window, pos)
|
||||
MagWindow *window;
|
||||
Point *pos; /* New crosshair location in coords of rootDef. */
|
||||
DBWSetCrosshair(
|
||||
MagWindow *window,
|
||||
Point *pos) /* New crosshair location in coords of rootDef. */
|
||||
{
|
||||
bool needUpdate = FALSE;
|
||||
|
||||
|
|
@ -617,8 +616,8 @@ DBWSetCrosshair(window, pos)
|
|||
*/
|
||||
|
||||
void
|
||||
dbwRecordBoxArea(erase)
|
||||
bool erase; /* TRUE means box is being erased from its
|
||||
dbwRecordBoxArea(
|
||||
bool erase) /* TRUE means box is being erased from its
|
||||
* current area. FALSE means box is being
|
||||
* added to a new area.
|
||||
*/
|
||||
|
|
@ -666,9 +665,9 @@ dbwRecordBoxArea(erase)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWDrawBox(window, plane)
|
||||
MagWindow *window; /* Window in which to redraw box. */
|
||||
Plane *plane; /* Non-space tiles on this plane indicate
|
||||
DBWDrawBox(
|
||||
MagWindow *window, /* Window in which to redraw box. */
|
||||
Plane *plane) /* Non-space tiles on this plane indicate
|
||||
* which highlight areas must be redrawn.
|
||||
*/
|
||||
{
|
||||
|
|
@ -797,12 +796,12 @@ dbwBoxAlways1(
|
|||
*/
|
||||
|
||||
void
|
||||
DBWSetBox(rootDef, rect)
|
||||
CellDef *rootDef; /* Root definition in whose coordinate system
|
||||
DBWSetBox(
|
||||
CellDef *rootDef, /* Root definition in whose coordinate system
|
||||
* the box is defined. It will appear in all
|
||||
* windows with this as root cell.
|
||||
*/
|
||||
Rect *rect; /* New box location in coords of rootDef. */
|
||||
Rect *rect) /* New box location in coords of rootDef. */
|
||||
{
|
||||
/* Record the old and area of the box for redisplay. */
|
||||
|
||||
|
|
@ -841,7 +840,8 @@ DBWSetBox(rootDef, rect)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWResetBox(CellDef *def)
|
||||
DBWResetBox(
|
||||
CellDef *def)
|
||||
{
|
||||
if (def == boxRootDef)
|
||||
boxRootDef = NULL;
|
||||
|
|
@ -873,17 +873,17 @@ DBWResetBox(CellDef *def)
|
|||
*/
|
||||
|
||||
void
|
||||
ToolMoveBox(corner, point, screenCoords, rootDef)
|
||||
int corner; /* Specifies a corner in the format
|
||||
ToolMoveBox(
|
||||
int corner, /* Specifies a corner in the format
|
||||
* returned by ToolGetCorner.
|
||||
*/
|
||||
Point *point; /* New position of corner, in screen
|
||||
Point *point, /* New position of corner, in screen
|
||||
* coordinates.
|
||||
*/
|
||||
int screenCoords; /* TRUE means point is in screen coordinates,
|
||||
int screenCoords, /* TRUE means point is in screen coordinates,
|
||||
* FALSE means root cell coordinates.
|
||||
*/
|
||||
CellDef *rootDef; /* Used only when screenCoords = FALSE, to
|
||||
CellDef *rootDef) /* Used only when screenCoords = FALSE, to
|
||||
* give root cell def.
|
||||
*/
|
||||
{
|
||||
|
|
@ -977,17 +977,17 @@ ToolMoveBox(corner, point, screenCoords, rootDef)
|
|||
*/
|
||||
|
||||
void
|
||||
ToolMoveCorner(corner, point, screenCoords, rootDef)
|
||||
int corner; /* The corner to be moved, in format
|
||||
ToolMoveCorner(
|
||||
int corner, /* The corner to be moved, in format
|
||||
* returned by ToolGetCorner.
|
||||
*/
|
||||
Point *point; /* Destination of corner. */
|
||||
int screenCoords; /* TRUE means point is in screen coordinates,
|
||||
Point *point, /* Destination of corner. */
|
||||
int screenCoords, /* TRUE means point is in screen coordinates,
|
||||
* we look up window and translate to root
|
||||
* cell coordinates. FALSE means point is in
|
||||
* coordinates of rootDef.
|
||||
*/
|
||||
CellDef *rootDef; /* Root cell Def if screenCoords = FALSE,
|
||||
CellDef *rootDef) /* Root cell Def if screenCoords = FALSE,
|
||||
* unused otherwise.
|
||||
*/
|
||||
{
|
||||
|
|
@ -1089,10 +1089,10 @@ ToolMoveCorner(corner, point, screenCoords, rootDef)
|
|||
*/
|
||||
|
||||
void
|
||||
ToolSnapToGrid(w, p, rEnclose)
|
||||
MagWindow *w;
|
||||
Point *p;
|
||||
Rect *rEnclose;
|
||||
ToolSnapToGrid(
|
||||
MagWindow *w,
|
||||
Point *p,
|
||||
Rect *rEnclose)
|
||||
{
|
||||
DBWclientRec *crec = (DBWclientRec *) w->w_clientData;
|
||||
Rect *r;
|
||||
|
|
|
|||
|
|
@ -137,10 +137,11 @@ dbwUndoInit()
|
|||
*/
|
||||
|
||||
void
|
||||
DBWUndoOldEdit(editUse, editRootDef, editToRootTrans, rootToEditTrans)
|
||||
CellUse *editUse;
|
||||
CellDef *editRootDef;
|
||||
Transform *editToRootTrans, *rootToEditTrans;
|
||||
DBWUndoOldEdit(
|
||||
CellUse *editUse,
|
||||
CellDef *editRootDef,
|
||||
Transform *editToRootTrans,
|
||||
Transform *rootToEditTrans)
|
||||
{
|
||||
char *useid = editUse->cu_id;
|
||||
editUE *ep;
|
||||
|
|
@ -159,10 +160,11 @@ DBWUndoOldEdit(editUse, editRootDef, editToRootTrans, rootToEditTrans)
|
|||
}
|
||||
|
||||
void
|
||||
DBWUndoNewEdit(editUse, editRootDef, editToRootTrans, rootToEditTrans)
|
||||
CellUse *editUse;
|
||||
CellDef *editRootDef;
|
||||
Transform *editToRootTrans, *rootToEditTrans;
|
||||
DBWUndoNewEdit(
|
||||
CellUse *editUse,
|
||||
CellDef *editRootDef,
|
||||
Transform *editToRootTrans,
|
||||
Transform *rootToEditTrans)
|
||||
{
|
||||
char *useid = editUse->cu_id;
|
||||
editUE *ep;
|
||||
|
|
@ -202,8 +204,8 @@ DBWUndoNewEdit(editUse, editRootDef, editToRootTrans, rootToEditTrans)
|
|||
*/
|
||||
|
||||
void
|
||||
dbwUndoChangeEdit(ep)
|
||||
editUE *ep;
|
||||
dbwUndoChangeEdit(
|
||||
editUE *ep)
|
||||
{
|
||||
Rect area;
|
||||
CellUse *use;
|
||||
|
|
@ -262,11 +264,11 @@ dbwUndoChangeEdit(ep)
|
|||
*/
|
||||
|
||||
void
|
||||
DBWUndoBox(oldDef, oldArea, newDef, newArea)
|
||||
CellDef *oldDef; /* Celldef containing old box. */
|
||||
Rect *oldArea; /* Area of old box in oldDef coords. */
|
||||
CellDef *newDef; /* Celldef containing new box. */
|
||||
Rect *newArea; /* Area of new box in newDef coords. */
|
||||
DBWUndoBox(
|
||||
CellDef *oldDef, /* Celldef containing old box. */
|
||||
Rect *oldArea, /* Area of old box in oldDef coords. */
|
||||
CellDef *newDef, /* Celldef containing new box. */
|
||||
Rect *newArea) /* Area of new box in newDef coords. */
|
||||
{
|
||||
BoxUndoEvent *bue;
|
||||
|
||||
|
|
@ -298,15 +300,15 @@ DBWUndoBox(oldDef, oldArea, newDef, newArea)
|
|||
*/
|
||||
|
||||
void
|
||||
dbwUndoBoxForw(bue)
|
||||
BoxUndoEvent *bue; /* Event to be redone. */
|
||||
dbwUndoBoxForw(
|
||||
BoxUndoEvent *bue) /* Event to be redone. */
|
||||
{
|
||||
DBWSetBox(bue->bue_newDef, &bue->bue_newArea);
|
||||
}
|
||||
|
||||
void
|
||||
dbwUndoBoxBack(bue)
|
||||
BoxUndoEvent *bue; /* Event to be undone. */
|
||||
dbwUndoBoxBack(
|
||||
BoxUndoEvent *bue) /* Event to be undone. */
|
||||
{
|
||||
DBWSetBox(bue->bue_oldDef, &bue->bue_oldArea);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ extern void ToolSnapToGrid();
|
|||
extern bool ToolGetEditBox(Rect *);
|
||||
extern void ToolMoveBox(), ToolMoveCorner();
|
||||
extern int ToolGetCorner();
|
||||
extern void DBWloadWindow(), DBWxloadWindow();
|
||||
extern void DBWloadWindow(MagWindow *window, char *name, unsigned char flags), DBWxloadWindow();
|
||||
extern void DBWSetBox();
|
||||
extern void DBWResetBox();
|
||||
extern void DBWUndoOldEdit();
|
||||
|
|
@ -260,7 +260,7 @@ extern void DBWElementNames();
|
|||
extern void DBWElementInbox();
|
||||
extern void DBWElementClearDef();
|
||||
extern void DBWElementParseFlags();
|
||||
extern char *DBWPrintElements();
|
||||
extern char *DBWPrintElements(CellDef *cellDef, unsigned char flagmask, int reducer);
|
||||
extern void DBWScaleElements();
|
||||
extern void DBWScaleCrosshair();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue